Originally posted by LordSegan:
I work for the Daily ***** (It's a Newspaper). We use a lot of pre-formatted text and I need a script that we can modify to insert one of several text strings upon pressing a button- like f12 etc. Anyone who could whip up a quick script or show me where/how to get one would be my best friend
That really isn't what AppleScript is at all. There is this line to describe but it seems to have slipped my mind.. like an intra-communication script...thingy between apps.. something like that.
Basically AppleScript can control apps, edit settings, perform text and mathematical operations. But simulating keys or anything similar is out of AppleScript's bounds.
Unless you use a scripting addition such as Sandi's Commands to simulate key commands. Look at
http://www.osaxen.com/ and download it.
Your script would look like this:
set the clipboard to "my favorite text"
TypeText "V" Command true
Or... if you don't want to take over the clipboard, look into AutoType (also available at osaxen.com).. the command would be:
AutoType "My favorite text."
Although I think you have to pay for that one...
Once you made your decision, save the script as an applet. Then go into the Keyboard control panel and assign a function key to the applet.
Also, this all assumes you are using OS 9. Otherwise, for OS X, you'll need to look into QuicKeys (ce.com)