A bad start: keystroke and submenu...
A bad start: keystroke and submenu...
- Subject: A bad start: keystroke and submenu...
- From: Simon Bernèche <email@hidden>
- Date: Wed, 12 Nov 2003 19:44:40 +0100
Hi,
I've tried to write my first AppleScript today and had a really bad
start. It was easier to get into Cocoa!
My goal is to to have a script which would change the dictionary
language in the spelling tool (inside Mail.app for example). I'm
running 10.3 on a Powerbook G4 and I did "enable access" in the
"Universal Access" panel.
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.
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)
I've remove "down" after "command" with the same result. But the script
is running if I remove "with command down" (i.e. I get the letter "n"
in some window in Mail). Am I missing something here? I'm clueless.
Thanks for your help.
Simon
_______________________________________________
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.