View Full Version : Applescript and "keystroke"

Jun 29, 2008, 02:40 PM
I am brand new to Macs and have run into a wall. You see, I am TRYING to send keystrokes to the active window. Under Windows XP, it was a VERY simple process using VBScript:

Dim oShell
Set oShell = WScript.CreateObject("WScript.Shell")

oShell.SendKeys "Enter some text here"
oShell.SendKeys "{ENTER}"
WScript.Sleep 850000

This would, regardless of the application, send the keystrokes to the active window. I am having a hell of a time trying to duplicate this simple process with Applescript. I have Googled until blue in the face, and have not found anything like what I was doing with VBScript.

Can anyone point me in the right direction?

Jun 30, 2008, 03:26 PM
Look at the last sample script on the following page: