• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: scripting System Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: scripting System Events
      • From: Walter Ian Kaye <email@hidden>
  • Prev by Date: BBedit Language module?
  • Next by Date: Re: To err on the exit code of the FIRST cmd of a piped do shell script
  • Previous by thread: Re: scripting System Events
  • Next by thread: Re: scripting System Events
  • Index(es):
    • Date
    • Thread