Sign in to follow this  
Followers 0
jedinerd

My script won't work and i have no idea why

2 posts in this topic

while 1

AutoItSetOption("WinTitleMatchMode", 2)

if ControlCommand("iPod", "", 1002, "IsEnabled", "") = 1 Then

MouseClick("left",330,442,1)

MouseClick("left",662,385,1)

EndIf

WEnd

as far as i can tell that SHOULD work but it just clicks constantly instead of only clicking when the button is enabled. I have watched the updater run and watched as the button is disabled and it clicks anyway. The only reason i am using mouse click instead of control click is that that wouldn't work either. Is there something wrong with my code or is the ipod updater just not compatible with autoit? My goal in the end is a program that will automatically restore ipods when they are plugged in. I had some variables defined so that the program would only run once for everytime itunes was opened but i stripped it back so i could try and isolate the problems i was havening. Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

The help file states:

Note: AutoIt only works with standard Microsoft controls - some applications write their own custom controls which may look like a standard MS control but may resist automation. Experiment!

Perhaps your software has nonstandard controls.

Also, I've seen some software that changes the controlID each time it runs, you might try the "ClassNameNN" instead.

You might also try this code layout as a test:

AutoItSetOption("WinTitleMatchMode", 2)
AutoItSetOption("TrayIconDebug", 1)

Do
    Sleep(500)
Until ControlCommand("iPod", "", 1002, "IsEnabled", "")

MouseClick("left", 330, 442, 1)
MouseClick("left", 662, 385, 1)

Edit: Welcome to the forums...

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0