Using script to automate typing?

Can any one help me? I am new at Apple script and would like to know is there a way to use applescript to automate typing. For example I would like to open word or Appleworks and open a blank document and have applescript begin typing a preset paragraph. Not copy and paste a paragraph but actually simulate each keystroke.
Please let me know if this is possible.

I don’t have AppleWorks on my machine so I used TextEdit as an example. If you install the GUI Scripting Beta then you can run the following script:


I installed the UI Scripting Beta and tried running your script but I keep getting an error of “Can’t get the application’s event dictionary” when it gets to the “System Events” line in your script.

Any guidance?
I did relaunch the app after I installed the UI scripting beta.


What do you mean re-launch? Did you restart or at least log out and log back in?


GUI scripting requires that “Enable access for assistive devices” be turned on in the Universal Access pref pane. This is usually the missing link when new installs of the System Events beta don’t work as expected. :wink:

– Rob