Re: Get Selected Finder Items behavior
Re: Get Selected Finder Items behavior
- Subject: Re: Get Selected Finder Items behavior
- From: Itai Rom <email@hidden>
- Date: Mon, 2 Mar 2009 14:37:34 -0800
In general, the files you drop on your applet will be the input to the
first action in your workflow. So sure, if you start the workflow
with Label Finder Items, then it will label the files you dropped on
the applet.
This is why you're getting the duplicates in your workflow below. The
files are passed into Get Selected Finder Items, which then appends
the Finder's selected files to its input and passes that list of files
on to Run Shell Script, so you end up getting each file input into Run
Shell Script twice. It's as if you started your workflow with two Get
Selected Finder Items actions.
Hope that clears things up!
-Itai
On Mar 2, 2009, at 2:33 PM, Scott Haneda wrote:
Thanks, is this why I am getting the duplicated? What if I wanted
to take some action on the dropped files, like setting their label,
or changing their names?
I am trying to understand the issue here so I can solve it in the
future if I need to.
On Mar 2, 2009, at 2:28 PM, Itai Rom wrote:
Scott,
If you're going to run this as a droplet, then you don't need to
start it with "Get Selected Finder Items." The files you drop on
it will automatically be input to your shell script action.
On Mar 2, 2009, at 2:21 PM, Scott Haneda wrote:
I am stumped on this one, first I thought it was an issue with
"$@" in shell scripts, but it appears not to be. Adding in a "Get
Selected Finder Items" and watching what it does when things are
dropped into it, will yield me a list of the items dropped.
When I try to interact with that list, the number of items in the
list are doubled when acted on, but in no way can I see where this
is happening. Here is my best case:
Create a new project
Add "Get Selected Finder Items"
Add "Run Shell Script"
Set pass input to argument
for f in "$@"
do
echo "$f" >> ~/Desktop/log.txt
done
Save as an application, drop a few files on it, the $@ variable
seems to contain 2x the items it should...
From my log
/Users/me/Desktop/test.txt
/Users/me/Desktop/untitled.txt
/Users/me/Desktop/untitled.txt
/Users/me/Desktop/test.txt
--
Scott
* If you contact me off list replace talklists@ with scott@ *
_______________________________________________
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
--
Scott
* If you contact me off list replace talklists@ with scott@ *
_______________________________________________
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