How can I launch an Automator application using AppleScript?

11,832

Solution 1

If I made an Automator app named Untitled I would start it by using this command tell application "Untitled" to activate

Once you create an application using one of the following methods, that application can be accessed in any other script via its name. It's defined globally, as is any other application on your mac. Just use the tell application "app Name"

Two ways of creating an application : Using AppleScript Using automator

Solution 2

activate app ((system attribute "HOME") & "/Desktop/test.app/")

You could also use the automator shell command.

automator test.workflow
automator test.app
automator test.workflow -v # verbose
automator -i lol test.workflow
echo lol | automator -i - test.workflow
automator -i $'lol\nlol2' test.workflow # \n separates input strings
automator -d somevar=somevalue test.workflow
Share:
11,832
beeglebug
Author by

beeglebug

SOreadytohelp

Updated on June 04, 2022

Comments

  • beeglebug
    beeglebug almost 2 years

    I am trying to use Remote Buddy to control Photo Booth, but I need a way to switch between Still and Video modes, my solution to this was to use an Automator app to select one or other of the two radio buttons when a remote button is pressed.

    I've created the .app, and it works fine when I double click it from the desktop, but I need a way to launch the .app from within Remote Buddy, and AppleScript seems to be my only option.

    tl;dr

    I need to be able to launch an Automator .app file using AppleScript, but can't figure out the correct syntax.