Reputation: 20429
I use Automator to do the following:
choose from list ...
)I understand how to pass folder chosen from step 1 to step 2. But I don't understand how to pass both variables between steps 2 and 3 (I can pass just one). I tried to return {answer, input}
at step 2. But shell-script fails with the error -[__NSArrayM fileSystemRepresentation]: unrecognized selector sent to instance 0x600000654b80
.
Upvotes: 1
Views: 922
Reputation: 285250
When passing the list of parameters to a shell script action for example
return {"/Applications", "com.apple.application-bundle"}
$@
represents the flattened list joined by spaces -> "/Applications com.apple.application-bundle"
$1
represents the first parameter -> "/Applications"
$2
represents the second parameter -> "com.apple.application-bundle"
and so on...
The shell script can look like
mdfind -onlyin $1 "kMDItemContentType == $2"
Note: Make sure that the parameters are passed as arguments rather than to stdin in the shell script action.
Upvotes: 2