Rename file based on File Path, then trim?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Rename file based on File Path, then trim? Fri Apr 29, 2011 8:48 am • by noodle1965
Hi,

I have a a rule that renames a file based on the file pathname.

I then want to strip part of the string to shorten the name, eg

/Users/username/Folder1/Folder2/Folder3/Folder4/Filename

Becomes

Folder3/Folder4/File

I have tried using

Name Matches /Users/username/Folder1/Folder2/(Custom Token "Anything")
Rename file with pattern (Custom Token "Anything")


but it does not work.

Anyone know hoe this could be done, maybe by a script?

Thanks for the help
noodle1965
 
Posts: 10
Joined: Sun Sep 13, 2009 12:37 am
Location: Perth, Western Australia

Couldn't get the renaming to work via Hazel, seemed line it recognised the file name as an actual path.

Was able to use a couple of Automator workflows to achieve what I was after.

Cheers
noodle1965
 
Posts: 10
Joined: Sun Sep 13, 2009 12:37 am
Location: Perth, Western Australia

I'm not quite sure what you are trying to do but it seems like you are moving the file around. Editing the folders in the path is basically moving the file somewhere else so you may want to re-frame what you are trying to do in that context.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support