![]() ![]() Set mousePos to do shell script "/usr/local/bin/cliclick p."īoth cliclick and MouseTools can be installed using Homebrew by typing the command brew install cliclick or brew install mousetools in the Terminal. If you want to get the location with cliclick, use this script: repeat 10 times As you can see, the screen size is still the same as when using MouseTools, still no idea why that is. This works the exact same way as the script above. I decided to rewrite the script to use cliclick because cliclick seems more modern and also faster: property screenX : 1439ĭo shell script "/usr/local/bin/cliclick c:" & ((mousePos * 100) mod screenX) & "," & ((mousePos * 100) mod screenY) The code above was tested in macOS 11.4 Beta on a 13-inch MacBook Air 2019 The end result when running this code in Affinity Photo, a similar product to Photoshop, which I saw you were planning to use it for: ![]() Set mousePos to do shell script "/usr/local/bin/mousetools -location" ![]() Also, the screenX and screenY values are changed when using MouseTools, you can get your screen size by running this script and moving your mouse to the bottom right: repeat 10 times Repeat with automatically increases the variable by one every time it loops, so I had to add the * 100. But as you can see, there is no set mousePos to mousePos + 100 but instead I used repeat with. Applescript 2. If you need to use the script, you also need to install cliclick. Note that I made a few changes: I don't think having two variables with the exact same value at all times is efficient so I changed both of them to mousePos. With the help of Bome Midi Translator Pro (and the code I’ve posted below), the user can press the C key 3 times and the script will automatically: 1) Find the xy coordinates of the Apply button (in Set Note Info) 2) Close the window. The correct way of doing this would be: property screenX : 1439ĭo shell script "/usr/local/bin/mousetools -x " & ((mousePos * 100) mod screenX) & " -y " & ((mousePos * 100) mod screenY) & " -leftClick" Something like MouseTools would fit your needs better. Using click at is not the right approach in this situation. ![]()
0 Comments
Leave a Reply. |