Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Are you able to: a) Execute a command line program from Ruby b) Save your Automator workflow as an application</p> <p>If so, you should be able to run the <code>open</code> command, e.g. <code>open test.app --args someArg</code>. Or you could use the <code>automator</code> command, such as <code>echo "someArg" | automator -i - test.app</code></p> <p>Note that the entire Automator script will run once for each argument - try having ‘Speak Text’ as your first item to verify this.</p> <p>To work with all the parameters in one go you need to actually pass just one and then split it up, e.g. <code>open test.app --args "one|two|three|four"</code> then something like</p> <pre> on run input set myArray to my theSplit(input as string, "|") set a to item 1 of myArray set b to item 2 of myArray set c to item 3 of myArray set d to item 4 of myArray display dialog "c is " & c --do stuff return str end run on theSplit(theString, theDelimiter) -- save delimiters to restore old settings set oldDelimiters to AppleScript's text item delimiters -- set delimiters to delimiter to be used set AppleScript's text item delimiters to theDelimiter -- create the array --set theArray to every text item of theString set theArray to text items of theString --display dialog theArray as string -- restore the old setting set AppleScript's text item delimiters to oldDelimiters -- return the result return theArray end theSplit </pre> <p>However, the AppleScript only seems to work if it’s not the first action. If you need it as the first action, which you probably do, insert a Run Shell Script first that just passes on the arguments:</p> <pre> for f do echo “$f" done </pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload