Page 1 of 1

Rename file based on File Path, then trim?

PostPosted: 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

Re: Rename file based on File Path, then trim?

PostPosted: Sat Apr 30, 2011 6:09 am
by noodle1965
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

Re: Rename file based on File Path, then trim?

PostPosted: Mon May 02, 2011 1:24 pm
by Mr_Noodle
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.