Re: A bad start: keystroke and submenu...
Re: A bad start: keystroke and submenu...
- Subject: Re: A bad start: keystroke and submenu...
- From: Bill Cheeseman <email@hidden>
- Date: Thu, 13 Nov 2003 07:05:26 -0500
on 2003-11-12 1:44 PM, Simon Bernhche at email@hidden wrote:
>
Maybe there's an easier solution but I've tried two things. I've first
>
tried calling the "Spelling..." panel using "keystroke" without success
>
(see below), then I tried to call the sub-menu directly but found out
>
that sub-menus ending with "..." (like "Spelling...") would create an
>
error, at least according to my own tests. Is this a known issue? I
>
didn't find anything about it in Google or on this list.
There is no consistency among applications from Apple or otherwise about
whether to create the ellipsis (...) as three separate periods or a single
Option-; character. When you run into this problem, you just have to
experiment to see which way the target application has done it.
>
About the keystroke problem. This sample script that I took from
>
Apple's web site is not working (I cannot even save it):
>
>
try
>
tell application "Mail"
>
activate
>
end tell
>
tell application "System Events"
>
tell process "Mail"
>
keystroke "n" with command down
>
end tell
>
end tell
>
on error
>
beep
>
end try
>
>
When I try to save this script in Script Editor" I get the following
>
message:
>
>
Expected into, variable name, class name, other parameter name or
>
property but found application constant or consideration.
>
(and "command down" is highlighted)
In Jaguar, the 'command down' parameter should be in a list created using
AppleScript's curly braces syntax, like so: 'keystroke "n" with {command
down}'. You can send the 'keystroke' command with multiple modifier keys
like so: 'keystroke "n" with {shift down, command down}'.
In Panther, you must say 'using' instead of 'with', due to Apple's change of
the terminology. This terminology change breaks old scripts, but that's OK
because GUI Scripting was beta technology under Jaguar and is no longer
supported by Apple under Jaguar.
By the way, my UI Browser application did not pick up on this terminology
change and still generates scripts using the incorrect 'with' terminology
under Panther. This will be fixed in UI Browser 1.2.1.
Hope this helps.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.