Using LiveCode & AppleScript to make mouse selection in another Mac application

Martin Koob mkoob at rogers.com
Thu Sep 5 17:05:48 EDT 2019


Hi

Sorry just read your subject and realized you are trying to select something.  What are you trying to select.  A line of text, an object?  What application are you trying to script?


Regards,

Martin Koob





> On Sep 5, 2019, at 5:00 PM, Martin Koob via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi
> 
> Are you wanting to moved object or a UI element to a new location which you would normally do with a mouse drag?  If so the application you are trying to script may have a ‘move' command.  Open the dictionary for the application you are scripting in the AppleScript Script Editor application and check whether  it has a move command.   I just checked and System Events has move in its dictionary as well as Finder and Calendar.   Would this achieve what you are trying to do?  I haven’t used this command so can’t give you any more info than this but I seems it would work in some cases.
> 
> Hope that helps.
> 
> 
> Regards,
> 
> Martin Koob
> 
> 
> 
> 
> 
>> On Sep 5, 2019, at 2:37 PM, Ben Rubinstein via use-livecode <use-livecode at lists.runrev.com> wrote:
>> 
>> As the title says...
>> 
>> I had a recollection that it was possible to construct a tool in LiveCode that would use AppleScript, System Events, and the accessibility framework to perform actions on another (not naturally scriptable) app.
>> 
>> I can do menu items, I can do keystrokes - but can I move the mouse? Or more to the point, can I move the mouse to a location, then click and drag to a new location?
>> 
>> Automator appears to be able to do this as a recording, which works once as a single step - but ever since hangs on playback (amusingly, it moves the mouse to the first point and then refuses to let it be moved anywhere else - pulling it back if it is - the only escape seems to be to use the keyboard to open a terminal and kill Automator).
>> 
>> Did I dream this, or is it possible?
>> 
>> TIA,
>> 
>> Ben
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list