Re: scripting applescript menu-clicking questions

2010-03-27 Thread Bernard Devlin
Thanks Sarah.

I have a bug in my applescript that is hard to work out.  But it
certainly seems in the later versions that one can get e.g. Safari to
do things with no "activate" command and the action takes place in an
open Safari, without brining it to the front.  I'll have to keep on at
this to see if it is a workable solution.


Bernard

On Fri, Mar 26, 2010 at 12:03 AM, Sarah Reichelt
 wrote:
> I am pretty sure that you can do this without the "activate" line.
>
> Scripting menu selections is weird in AppleScript, but here is a good
> article about it:
> 
>
> Don't forget to activate "Enable access for assistive devices" in the
> "Universal Access" system pref.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: scripting applescript menu-clicking questions

2010-03-25 Thread Sarah Reichelt
> I am having trouble with getting applescript to click on menu choices
> in Safari (there is nothing in the dictionary for what I'm trying to
> do).  Does anyone have any suggestions for how to handle these things?
>
> Secondly, will Safari be able to do these actions in the background?
> I mean, in the script I'm currently working on, Safari is told to
> "activate", then everything else happens.  Can I script menu
> actions/button clicks without Safari becoming visible?

I am pretty sure that you can do this without the "activate" line.

Scripting menu selections is weird in AppleScript, but here is a good
article about it:


Don't forget to activate "Enable access for assistive devices" in the
"Universal Access" system pref.

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


Re: scripting applescript menu-clicking questions

2010-03-25 Thread Ian Wood


On 25 Mar 2010, at 15:02, Bernard Devlin wrote:


Thank you very much, Ian.  Much appreciated.  Amazing how much
knowledge is available on this list. :)


I mostly use Rev to create OS X 'bridges' between different apps, so  
GUI scripting comes in handy.



I'll look into Prefab UIBrowser.  Hopefully it is something I can
distribute with my app.


UIBrowser lets you see the exact path to any UI element in any app and  
then gives you the AppleScript syntax for performing actions on/ 
getting info about those elements. It also gives you the syntax for  
sending keypresses and all sorts of other info. In some cases you can  
even get values from text fields and sliders for apps without  
scripting dictionaries.


So it's a tool for helping you write the AppleScripts, without any  
need for you to then distribute it.


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


Re: scripting applescript menu-clicking questions

2010-03-25 Thread Bernard Devlin
Thank you very much, Ian.  Much appreciated.  Amazing how much
knowledge is available on this list. :)

I'll look into Prefab UIBrowser.  Hopefully it is something I can
distribute with my app.

Bernard

On Thu, Mar 25, 2010 at 2:43 PM, Ian Wood  wrote:
> Off the top of my head...
>
> On 25 Mar 2010, at 13:48, Bernard Devlin wrote:
>
>> Hi all,
>>
>> I am having trouble with getting applescript to click on menu choices
>> in Safari (there is nothing in the dictionary for what I'm trying to
>> do).  Does anyone have any suggestions for how to handle these things?
>
> Buy Prefab UIBrowser. Absolutely indispensable for this kind of stuff even
> though it hasn't been updated in a couple of years.
>
>> Secondly, will Safari be able to do these actions in the background?
>> I mean, in the script I'm currently working on, Safari is told to
>> "activate", then everything else happens.  Can I script menu
>> actions/button clicks without Safari becoming visible?
>
> Anything involving mouse clicks *have* to be done with the target app
> frontmost. Menus will probably be the same.
>
>> Finally, assuming that all of this is possible, is there a version of
>> Applescript/OS X before which such things would not be possible?
>
> 10.2 required an additional download for GUI scripting, 10.3 had it
> built-in, but full features came with 10.4 and above.
>
> Ian
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: scripting applescript menu-clicking questions

2010-03-25 Thread Ian Wood

Off the top of my head...

On 25 Mar 2010, at 13:48, Bernard Devlin wrote:


Hi all,

I am having trouble with getting applescript to click on menu choices
in Safari (there is nothing in the dictionary for what I'm trying to
do).  Does anyone have any suggestions for how to handle these things?


Buy Prefab UIBrowser. Absolutely indispensable for this kind of stuff  
even though it hasn't been updated in a couple of years.



Secondly, will Safari be able to do these actions in the background?
I mean, in the script I'm currently working on, Safari is told to
"activate", then everything else happens.  Can I script menu
actions/button clicks without Safari becoming visible?


Anything involving mouse clicks *have* to be done with the target app  
frontmost. Menus will probably be the same.



Finally, assuming that all of this is possible, is there a version of
Applescript/OS X before which such things would not be possible?


10.2 required an additional download for GUI scripting, 10.3 had it  
built-in, but full features came with 10.4 and above.


Ian

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


scripting applescript menu-clicking questions

2010-03-25 Thread Bernard Devlin
Hi all,

I am having trouble with getting applescript to click on menu choices
in Safari (there is nothing in the dictionary for what I'm trying to
do).  Does anyone have any suggestions for how to handle these things?

Secondly, will Safari be able to do these actions in the background?
I mean, in the script I'm currently working on, Safari is told to
"activate", then everything else happens.  Can I script menu
actions/button clicks without Safari becoming visible?

Finally, assuming that all of this is possible, is there a version of
Applescript/OS X before which such things would not be possible?

Thanks,

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