I have a series of files that are basically named “My File - Feb 27 2004 Part 1.doc” that I download on a regular basis. The prefix "My File - " always remains the same. The date is the thing that (duh constantly changes.
I would like to be able to remove the text "My File - " from every file that I process using either a folder action or droplet.
Save this as an application (droplet) and it might work. Note that it will work only on dropped files. Let us know if you need to process folders.
on open items_
repeat with item_ in items_
tell application "Finder"
if kind of item_ is not "Folder" then
set name_ to name of item_
if name_ begins with "My File - " then
try
set name of item_ to (text 11 thru end of name_)
on error e
display dialog e buttons {"OK"} default button 1 with icon 0
end try
end if
end if
end tell
end repeat
end open