Hi everyone,
I know this may inflame the Applescript/Shell script debate again,
but I'm trying to automate something that apparently can only be
done
at a command prompt. Please prove this wrong and show me an
Applescript way.
I'm trying to use Automator to create a Finder plug-in that will
allow a right-click on selected file(s) to add those files to the
Dock. So far, I've been able to get the Finder plug-in to work,
calling an Applescript in which I'm using "do shell script" to add
the item(s) to the Dock. But I can't get the selected file to
pass to
the Shell Script as an argument. Here is the Workflow:
Get Specified Finder Items > Run Applescript
on run {input, parameters}
do shell script "additemtodock "
return
end run
I've also tried setting the selection to a variable like:
on run {input, parameters}
tell application "Finder"
set theFile to selection
do shell script "additemtodock " & theFile
return
end tell
end run
But I get nothing.
The shell script "additemtodock" works when run alone in the
shell,
given any file as an argument (additemtodock filename)
If I run the Applescript:
tell application "Finder"
set theFile to selection
do shell script "additemtodock " & theFile
return
end tell
the Dock is restarted, but the item is not added. Script Debugger
does correctly show the List of the selection, however. If I
run the
Automator Workflow, the same thing happens--the Dock is restarted,
but the item is not added.
Any help is greatly appreciated.
Thanks,
David Wolfe
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
40mail.com
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
--
Mark J. Reed <email@hidden>