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

2019-09-11 Thread Ben Rubinstein via use-livecode

Keyboard Maestro is indeed the best solution, thank you Bob.

FWIW I'd just managed to find a horrible hack, by enabling the "Mouse Keys" 
facility, and using System Events to send numeric keypad codes to lock the 
mouse down and move it - one pixel at a time


Keyboard Maestro is a rather better solution, and looks excellent.

Thanks for the tip!

Ben

On 11/09/2019 05:28, Rick Harrison via use-livecode wrote:

Hi Bob,

Thanks for telling us about Keyboard Maestro!

I used to use Quikeys for Mac for a long time, but
they haven’t updated it for quite some time and
I was hoping to find a substitute.  It looks like
Keyboard Maestro is like Quikeys on Steroids!

Thanks again,

Rick


On Sep 10, 2019, at 5:52 PM, Bob Sneidar via use-livecode 
 wrote:

You need a Macro program. I like Keyboard Maestro.

Bob S


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


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

2019-09-10 Thread Rick Harrison via use-livecode
Hi Bob,

Thanks for telling us about Keyboard Maestro!

I used to use Quikeys for Mac for a long time, but
they haven’t updated it for quite some time and
I was hoping to find a substitute.  It looks like
Keyboard Maestro is like Quikeys on Steroids!

Thanks again,

Rick

> On Sep 10, 2019, at 5:52 PM, Bob Sneidar via use-livecode 
>  wrote:
> 
> You need a Macro program. I like Keyboard Maestro. 
> 
> Bob S

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


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

2019-09-10 Thread Bob Sneidar via use-livecode
You need a Macro program. I like Keyboard Maestro. 

Bob S


> On Sep 10, 2019, at 13:14 , Ben Rubinstein via use-livecode 
>  wrote:
> 
> Hi Tom and Martin,
> 
> Thanks for the responses. That's where I'm at the moment; the problem is that 
> I AFAICT I can click at a position using System Events; but I can't click at 
> one location and release at another. The issue is that I'm trying to make a 
> rectangular selection, encompassing a number of elements; rather than trying 
> to select an actual element.
> 
> This is actually to crop each page of a many page PDF, using the rectangular 
> selection tool in either Preview or PDFpen. (AFAICT ImageMagick is no good 
> because it rasterises PDF pages before cropping them, whereas I want to 
> retain  all the PDF fidelity goodness, but just mask each page.)
> 
> I can click: but I can't mouse down in one location, and release it in 
> another.
> 
> Ben
> 
> On 05/09/2019 20:59, Tom Glod via use-livecode wrote:
>> I dunno if this works but you can try
>> do myscript as "Applescript"
>> abd your myscript can be
>> tell application "System Events"
>>   click at {123,456}end tell
>> I'm currently working on debugging a tool that uses applescript to
>> send keystrokes..and i'm finding it inconsistent ...but it could just
>> be me, so for now I won't say that its the applescript functionality.
>> On Thu, Sep 5, 2019 at 2:38 PM Ben Rubinstein via use-livecode <
>> use-livecode@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@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@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


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

2019-09-10 Thread Ben Rubinstein via use-livecode

Hi Tom and Martin,

Thanks for the responses. That's where I'm at the moment; the problem is that 
I AFAICT I can click at a position using System Events; but I can't click at 
one location and release at another. The issue is that I'm trying to make a 
rectangular selection, encompassing a number of elements; rather than trying 
to select an actual element.


This is actually to crop each page of a many page PDF, using the rectangular 
selection tool in either Preview or PDFpen. (AFAICT ImageMagick is no good 
because it rasterises PDF pages before cropping them, whereas I want to retain 
 all the PDF fidelity goodness, but just mask each page.)


I can click: but I can't mouse down in one location, and release it in another.

Ben

On 05/09/2019 20:59, Tom Glod via use-livecode wrote:

I dunno if this works but you can try

do myscript as "Applescript"

abd your myscript can be

tell application "System Events"
   click at {123,456}end tell

I'm currently working on debugging a tool that uses applescript to
send keystrokes..and i'm finding it inconsistent ...but it could just
be me, so for now I won't say that its the applescript functionality.





On Thu, Sep 5, 2019 at 2:38 PM Ben Rubinstein via use-livecode <
use-livecode@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@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


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

2019-09-05 Thread Martin Koob via use-livecode
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 
>  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 
>>  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@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


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

2019-09-05 Thread Martin Koob via use-livecode
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 
>  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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


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

2019-09-05 Thread Tom Glod via use-livecode
I dunno if this works but you can try

do myscript as "Applescript"

abd your myscript can be

tell application "System Events"
  click at {123,456}end tell

I'm currently working on debugging a tool that uses applescript to
send keystrokes..and i'm finding it inconsistent ...but it could just
be me, so for now I won't say that its the applescript functionality.





On Thu, Sep 5, 2019 at 2:38 PM Ben Rubinstein via use-livecode <
use-livecode@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@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@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode