Hello, I have an iMac and am using an iPad to display a custom panel within the accessibility keyboard. The custom (by me) accessibility keyboard contains multiple buttons which each run an appleScript.
Everything is working perfectly except for an annoying problem. Every time I tap on a button on the iPad, the AppleScript runs perfectly BUT the cursor relocates to the iPad, and I am stuck manually repositioning it on my iMac main screen which requires a somewhat tortuous and repetitive hand movement.
What I would like to achieve it the ability to
1- get cursor position
2- run the initially intended appleScript
3- restore cursor position
obviously all within one script
For example, I configured a button to run the following script to open reddit:
tell application “Chrome”
open location “reddit.com”
Is there a ‘simple’ way to modify that script to first ‘get’ or ‘capture’ (I hope that the wording is correct) the cursor position on the main screen → open reddit in Chrome → restore the cursor position on the main screen ?
thanks in advance very much for your time and help