Jump to content

ControlClick help needed :)


Recommended Posts

Hi,

I'd like my script to click 3 times at a defined coords in Photoshop but I just can't figure out how the syntax should look like.

This is how I wrote it but it doesn't work :/

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <Misc.au3>

$Coordss = AskUser()

MsgBox(0, "", $Coordss[0] & "       " & $Coordss[1])


Func AskUser()
    MsgBox(262144, "User Input", "Please click the screen on a certain spot" & @CRLF & "Press OK, and then move your mouse there and click")
    Do
        Sleep(50)
    Until _IsPressed(01)
    $Coordss = MouseGetPos()
    ;MsgBox(0, "Thank You", "Your coords have been stored for later use")
    Return $Coordss
EndFunc  ;==>AskUser



$Input = InputBox("InputBox", "Coords", $Coordss[0] &"," & $Coordss[1])
$aCoords = StringSplit($Input, ",", 2)

Sleep(3000)

ControlClick("[CLASS:Photoshop]","","","left",3,$aCoords[0],$aCoords[1])
Edited by reverse
Link to comment
Share on other sites

Without being able to test...the first param should be the window handle/title/class, and the third should be the ControlID of the control you want to click.  Like I said, I can't test it, but I'm guessing your third param ([CLASS:Photoshop]) may be be the window and not the control.  I'm not even sure if you can inspect the control you want (or if ContrlClick can even interact with it). 

You may end up having to use WinActivate and MouseClick instead...of course the biggest limitation of this is you'll loose any ability to interact with the application while the computer is locked.

Link to comment
Share on other sites

The script should click 3 times on a text layer (which is at those coords) in photoshop to select all text in this layer.

Then it should paste new text from clipboard and save file (it does that part well).

Edited by reverse
Link to comment
Share on other sites

Link to comment
Share on other sites

you could try and add in

Opt("WinTitleMatchMode", 2)

ControlClick("Photoshop","","[CLASS:Static; INSTANCE:20]","left",3,$aCoords[0],$aCoords[1])

I have to use WinTitleMatchMode, 2 to access most of the programs I am using as setting by control alone has been a nightmare for me (user error more than likely)

Corrected typos number 1 reason I edit :(

Edited by tweakster2010
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...