flip
Apr 19, 2006, 08:11 PM
How about some Automator tips?
Here's a workflow to batch rename the Path Finder selection from the contextual menu.
1. Launch Automator and create a new workflow (File > New).
2. In the Library column, select "Automator".
3. In the Action column, double-click on "Run AppleScript".
4. Set the script to:
on run {input, parameters}
tell application "Path Finder"
set a_list to selection
set input to {}
repeat with a_ref in a_list
set a_path to POSIX path of a_ref
tell me to set a_file to POSIX file a_path
set input to input & {a_file}
end repeat
end tell
return input
end run
(Make sure it compiles by clicking on the hammer icon.)
5. In the Library column select "Finder".
6. In the Action column double-click on "Rename Finder Items" (answer No when you're prompted about duplicating the files first).
7. Use the popup menus to define the default renaming method (you'll be able to change it at run time).
8. Check the Show Action When Run checkbox under Options to be prompted when the workflow runs.
9. Save the workflow as Plug-in (File > Save As Plug-in).
10 Call it something like "Batch Rename Path Finder Selection", and make sure "Finder" is selected in the second pop-up.
That's it. If PF is set to "Append Finder contextual menu items" (from the Contextual menu preferences), you'll find your new workflow in the Automator submenu of the contextual menu. Select several files or folders in PF, use this new command, and a dialog allowing you to define how to rename the selected items will pop up.
Important
This workflow requires the Finder. If it's not running, it will be launched (assuming you didn't completely replace it with PF, in which case you're probably out of luck). If you want the Finder to quit again when the workflow is done running, just add another "Run AppleScript" action at the end of the workflow, and set its script to 'tell application "Finder" to quit'.
Enjoy!
Here's a workflow to batch rename the Path Finder selection from the contextual menu.
1. Launch Automator and create a new workflow (File > New).
2. In the Library column, select "Automator".
3. In the Action column, double-click on "Run AppleScript".
4. Set the script to:
on run {input, parameters}
tell application "Path Finder"
set a_list to selection
set input to {}
repeat with a_ref in a_list
set a_path to POSIX path of a_ref
tell me to set a_file to POSIX file a_path
set input to input & {a_file}
end repeat
end tell
return input
end run
(Make sure it compiles by clicking on the hammer icon.)
5. In the Library column select "Finder".
6. In the Action column double-click on "Rename Finder Items" (answer No when you're prompted about duplicating the files first).
7. Use the popup menus to define the default renaming method (you'll be able to change it at run time).
8. Check the Show Action When Run checkbox under Options to be prompted when the workflow runs.
9. Save the workflow as Plug-in (File > Save As Plug-in).
10 Call it something like "Batch Rename Path Finder Selection", and make sure "Finder" is selected in the second pop-up.
That's it. If PF is set to "Append Finder contextual menu items" (from the Contextual menu preferences), you'll find your new workflow in the Automator submenu of the contextual menu. Select several files or folders in PF, use this new command, and a dialog allowing you to define how to rename the selected items will pop up.
Important
This workflow requires the Finder. If it's not running, it will be launched (assuming you didn't completely replace it with PF, in which case you're probably out of luck). If you want the Finder to quit again when the workflow is done running, just add another "Run AppleScript" action at the end of the workflow, and set its script to 'tell application "Finder" to quit'.
Enjoy!