reverse Posted March 19, 2015 Share Posted March 19, 2015 (edited) 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 March 19, 2015 by reverse Link to comment Share on other sites More sharing options...
spudw2k Posted March 19, 2015 Share Posted March 19, 2015 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. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
reverse Posted March 19, 2015 Author Share Posted March 19, 2015 I just edited my first post to show you entire script. But it still doesn't work :/ Link to comment Share on other sites More sharing options...
JohnOne Posted March 19, 2015 Share Posted March 19, 2015 Yes, add the ID of the control. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
reverse Posted March 19, 2015 Author Share Posted March 19, 2015 (edited) This is what I get when I use Window Info I tried something like this: ControlClick("[CLASS:Photoshop]","", 6715 ,"left",3,176,255) but it doesn't work :/ I know I'm doing something wrong but I don't know what :/ Edited March 19, 2015 by reverse Link to comment Share on other sites More sharing options...
JohnOne Posted March 19, 2015 Share Posted March 19, 2015 Static controls are usually labels, what is supposed to happen? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
reverse Posted March 19, 2015 Author Share Posted March 19, 2015 (edited) 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 March 19, 2015 by reverse Link to comment Share on other sites More sharing options...
spudw2k Posted March 19, 2015 Share Posted March 19, 2015 You could try changing the ID number to the class name (in your example above change 6715 to "Static20"), but I'm not sure it'll work that way either. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
reverse Posted March 19, 2015 Author Share Posted March 19, 2015 You could try changing the ID number to the class name (in your example above change 6715 to "Static20"), but I'm not sure it'll work that way either. It didn't help :/ Maybe I should stay with mouseclick Link to comment Share on other sites More sharing options...
tweakster2010 Posted March 19, 2015 Share Posted March 19, 2015 (edited) 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 March 19, 2015 by tweakster2010 Link to comment Share on other sites More sharing options...
232showtime Posted March 25, 2015 Share Posted March 25, 2015 why do you want to automate photoshop??? silly question.. ill get to that... i still need to learn and understand a lot of codes Correct answer, learn to walk before you take on that marathon. Link to comment Share on other sites More sharing options...
Wingens Posted March 27, 2015 Share Posted March 27, 2015 Maybe a dump newbie remark of mine. But had a simular problem with a setup i was trying to controlclick, i had to use #requireadmin otherwise the script did nothing. Hope this helps Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now