Re: Use of Rename Finder Item
Re: Use of Rename Finder Item
- Subject: Re: Use of Rename Finder Item
- From: "N. Pomeroy" <email@hidden>
- Date: Wed, 27 Jun 2007 15:39:40 -0700
On Wed, 27 Jun 2007 12:50:12 -0700, quoth email@hidden:
> I have a workflow:
> Find Finder Items
> Run Workflow (Combine PDF's)
> Move Finder Items - to final directory
> Rename Finder Items (Add Text to Finder Item Names)
> The Combine PDF's generates a random file name like "g5C1yW.pdf"
> In the Rename step I am using "Add Text before name" obtaining something
> like 'EIS Pieces Charts - g5C1yW.pdf"
> but I would like to replace the random characters to obtain "EIS Pieces
> Charts.pdf"
I put together this workflow which does something similar (use at your own risk, test with your setup):
1. Get Select Finder Item (should be switched out for your "Find Finder Items")
2. Combine PDF Pages
3. Run Shell Script (shell: bash, input as arguments)
the script:
for f in "$@"
do
mv "$f" ~/tmp/temppdf.pdf
done
4. Find Finder Items (on computer, whose name is temppdf.pdf)
5. Rename Finder Items (Replace Text; pre-populate Find field with "temppdf.pdf"; show action when run to add on-the-fly names)
6. Move Finder Items
7. Run shell script (bash, pass input to stdin)
the script:
rm ~/tmp/temppdf.pdf
The first shell script in action #3 picks up the output name from Combine PDF Pages without you having to intervene, or even know what it is.
I originally played with using the sed command-line tool to match any possible naming pattern from the Combine PDF action, renaming it with sed. It was more complex than I had time to put into it. The above method was just too straightforward to pass up.
If you wanted to clean up or delete the original files, you could experiment with putting a "Move to Trash" action after action #3, but before #4. I haven't tried any other cleanup on this than what you see.
Good luck
-N
_______________________________________________
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