How do you pass a file path to Automator's "Run Shell Script" action
How do you pass a file path to Automator's "Run Shell Script" action
- Subject: How do you pass a file path to Automator's "Run Shell Script" action
- From: Marvin Gardens <email@hidden>
- Date: Thu, 01 May 2014 23:55:07 -0700
I've been working my way through Ben Waldies Automator book (Snow
Leopard version) and have gotten stuck on how to pass a path from a "Ask
for Finder Items" action to a "Run Shell Script" action. The workflow
has only two steps, Ask for Finder Items ---> Run Shell Script.
The shell script is simply "ln -s /file/to/input /path/to/output/" The
output path can be hard coded - It will always be the Desktop folder.
Thus far I can't figure out how to put /file/to/input at the right spot
in the script.
With AppleScript, I can use this script saved as a drag and drop
application:
on open (theItem)
set targFile to item 1 of theItem as alias
set QPP to quoted form of POSIX path of targFile
set targFolder to quoted form of POSIX path of (path to desktop folder)
set shellScpt to "ln -s " & QPP & " " & targFolder
do shell script shellScpt
end open
I can also use this script in a "Run AppleScript" action in Automator:
Ask for Finder Items ---> Run AppleScript
on run {input, parameters}
set input to quoted form of POSIX path of input
set targFolder to quoted form of POSIX path of (path to desktop folder)
set shellScpt to "ln -s " & input & " " & targFolder
do shell script shellScpt
end run
However, I'd sure like to learn how to do it in the shell with Automator
if anyone can help me.
Thanks
James
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden