Sign in to follow this  
Followers 0
Jani S.

Just Can't Figure Out How To Use Calnnnamenn Or Controlid From Script

3 posts in this topic

#1 ·  Posted (edited)

Hi you all gurus,

I just can't figure it out myself how to use ControlID or CalssNameNN to cotrol for example Windows Media Player.

The thing I'd like to do is that I want to use either one of ClassName or ControlID to locate what button will "pressed" next from script.

This is what I want to do (example):

- Open Media Player Classic (or some other program)

- Press File from to menu (CalssName is ScrollBar1) --> Press Open File from menu(ClassName is Edit1)

BR,

Jani

Ps. the topic should be saying:

Just Can't Figure Out How To Use CLassNameNN Or ControlID From Script

Had one script running background when is was writing topic so it got messed up... :think:

Edited by Jani S.

Share this post


Link to post
Share on other sites



Just Can't Figure Out How To Use CLassNameNN Or ControlID From Script

First you want to use the "AutoIt v3 Active Window Info" program that is installed with AutoIt3. Use that to find the Window name, button names, control id's etc. However, with Media Player Classic, all you need to do is send a CTRL-O to open a file dialog:

run("c:\program files\media player classic")
winwait("Media Player Classic")
send("^O")
msgbox(1,"Notice","Did it!")

To send a controlclick to a button, you can try this:

;run("c:\program files\mediaplayerclassic\mpc.exe");run media player classic - use your path
;winwait("Media Player Classic"); wait until it's open
WinActivate("Media Player Classic"); bring up the mpc screen if it's not already up
Send("!vO")
WinWait("Options")
for $i = 1 to 10
    controlclick("Options","Open options",1044)
    Sleep(500)
    controlclick("Options","Open options",1045)
Next

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format

Share this post


Link to post
Share on other sites

First you want to use the "AutoIt v3 Active Window Info" program that is installed with AutoIt3. Use that to find the Window name, button names, control id's etc. However, with Media Player Classic, all you need to do is send a CTRL-O to open a file dialog:

run("c:\program files\media player classic")
winwait("Media Player Classic")
send("^O")
msgbox(1,"Notice","Did it!")

To send a controlclick to a button, you can try this:

;run("c:\program files\mediaplayerclassic\mpc.exe");run media player classic - use your path
;winwait("Media Player Classic"); wait until it's open
WinActivate("Media Player Classic"); bring up the mpc screen if it's not already up
Send("!vO")
WinWait("Options")
for $i = 1 to 10
    controlclick("Options","Open options",1044)
    Sleep(500)
    controlclick("Options","Open options",1045)
Next

Wow, that was fast :think:

Now I get it. It was simple as I first thought, but went to wrong direction...

Thanks alot!

BR,

Jani

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