Simulating Keystrokes

Hello. I am an Applescripting Rookie. Here is what I am trying to do:

  • Open an application (got this part down)
  • After it opens, simulate a user pressing: SHIFT + CMD + ‘S’ (s key)

That’s all. Is this even possible?

Thanks in advance.


It’s not possible without a third party application or scripting addition. I recommend that you consider X-Commands, a background application that makes dozens of commands available to scripters. You can then use something like:

tell application "X-Commands"
	type key "s" with command and shift
end tell

Rob, thanks for the heads up.


hello guys,

how about assigning keystroke commands to the scripts themselves? like the OSA menu does in OS 9

this is what i want to do: there is a script included in the OS X scripts folder that switches to the finder and hides all the other applicatios and their windows, i want to be able to do this with a keystroke, is this possible?

thanks in advanced


then, you need quickeys, key xing, youpi key, keyboard maestro or… take a look at or

thank you for the suggestions jj
i tried youpi key and love it so far


lalo, Please check out the newest (beta 2.0) version of the ScriptEditor from Apple. It offers vast improvements over the previous versions of the ScriptEditor. Follow the threads on the Scripting Editors forum. There’s a lot of info starting to flow in and I’m sure you’ll be interested in participating in the discussion.


I think you can do what you want now or at least very soon. Check this out:

Bye for now,


For the sake of clarity, and if I understand everything that I’ve installed in the last couple of days…

I don’t think that Script Editor 2 is responsible for the interface stuff. It’s the new “System Events” app that comes with Dev Tools that offers all of the additional interface scripting options. It’s important to remember that it’s all beta/preview software, so:

  • It’s likely to be buggy.
  • It isn’t going to be practical for distributed scripts until it is released in an official OS update.
  • It’s likely to change by the time it is released for general consumption.
  • Apple could say to heck with it and never release it.

It’s simply provided so that we can start to learn about what is, or might be, coming in the months ahead. :slight_smile: