Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

imanta

macrumors newbie
Original poster
Jul 11, 2005
16
0
I am just looking to create an Applescript that will attach to an application and execute some keystrokes in the application. Example, I have Word open and I want an AS to write "Hello World" in the active window.

Is this even possible? Any good sites to show me where to even begin?

Thanks!
 
This should do it....

tell application "Microsoft Word"
activate
end tell

tell application "System Events"
tell process "Microsoft Word"
keystroke "Goodbye World!"
keystroke return
keystroke "*Jumps off roof*"
keystroke return
keystroke "AHHHHHHHHH!"
keystroke return
keystroke "*Splat*"
end tell
end tell
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.