Re: scripting System Events
Re: scripting System Events
- Subject: Re: scripting System Events
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 08 Dec 2003 17:05:31 -0500
on 2003-12-08 3:50 PM, David DuBois at email@hidden wrote:
>
Can anyone tell me why this doesn't work for applying a command shift J in
>
finder? I thought that if something could not be addressed directly, by using
>
system events you could address the menu directly, but I don't have it quite
>
right.
>
>
>
tell application "Finder" to activate
>
tell application "System Events"
>
tell process "Finder" to keystroke "J" using command shift down
I see three problems here:
1. you didn't close the 'tell application "System Events" block with the
required 'end tell'
2. when 'using' multiple modifier keys, they should be in a list, like so:
'{command down, shift down}'
3. you should type a lower case "j", since an upper case "J" is already
interpreted as a lower case "j" with the shift key down. (Therefore,
'keystroke "J" using command down' will work, too, but it will likely be
confusing to anybody trying to read your script.)
--
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.