Re: Stuck with GUI scripting
Re: Stuck with GUI scripting
- Subject: Re: Stuck with GUI scripting
- From: Bill Cheeseman <email@hidden>
- Date: Tue, 13 Dec 2005 05:58:26 -0500
- Thread-topic: Stuck with GUI scripting
on 2005-12-12 8:36 PM, Brett Conlon at email@hidden wrote:
> I've managed to get the pop up button working with the below code. I stumbled
> on the answer when I tried to re-create the code to work with Safari to see if
> it was just FreeHand having the issue.
>
> When I issued the Print command to Safari (outside of System Events) it just
> went and printed the loaded web page without producing the Print dialog so I
> had to turn to using the SystEv code to make the Print dialog appear and the
> rest just worked from there... I then translated the code back to FreeHand and
> it also worked!!!:
>
> tell application "FreeHand MX"
> activate
> tell application "System Events"
> tell process "FreeHand MX"
> click menu item "Print..." of menu 1 of menu bar item
> "File" of menu bar 1
That's great! I had misunderstood which line of the script you were stuck
on.
Another way to open the print dialog is to do this:
keystroke "p" using {command down}
Notice that the "p" must be lowercase; otherwise, GUI Scripting will think
the Shift key must be down. This might avoid the flashing menu that you
sometimes get with the 'click' on a menu item.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
PreFab Software - http://www.prefab.com/scripting.html
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden