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

reddrag0n

macrumors 6502a
Original poster
Oct 1, 2007
606
153
Canada
this may or may not be already discussed, but how do i make an application press specific keys for functions in automator or applescript?

aka once a program is launched, automator or applescript will see said program and press keys like "F2" and then "Enter" or that sort of thing...

it's being run within rosetta on 10.6 as it's a ppc app that i'm trying to automate
 

Red Menace

macrumors 6502a
May 29, 2011
580
226
Colorado, USA
The best approach is to use the terminology provided by the application's scripting dictionary, if the developer provided any, otherwise you are stuck with scripting the UI using System Events (see its Processes Suite).

If you are talking about getting notifications when an application is launched, being able to use AppleScriptObjC from regular scripts (including Automator's Run AppleScript) didn't happen until 10.10 Yosemite. Before that you were limited to applications via the Cocoa-AppleScript template and library scripts.

Note that both Automator and Script Editor have scripting dictionaries.
 

reddrag0n

macrumors 6502a
Original poster
Oct 1, 2007
606
153
Canada
hmm, ok. basically what i have is one program, once it launches, it has commands to launch other programs from within itself. those other programs themselves have built in abilities to log into my server and do their specified functions, while this one program i have does not have this functionality.
i remember years ago tinkering with script editor and under the record ability, it was able to mimic my mouse commands and do what i need it to do, but i am seeing if there was an easier way
 

reddrag0n

macrumors 6502a
Original poster
Oct 1, 2007
606
153
Canada
after doing a little searching on youtube (of all places) someone pointed out that automator has a "watch me do" function that catches the mouse actions. since the windows don't change on a headless server, the mouse actions should be consistent after any reboot. after testing it within screen sharing and running it standalone headless, it works
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.