Spotlight under 10.4 makes searching by filename really easy. However for images and movies it appears to rely only filenames. So I’m trying to write a script to append my file names with part of the file pathname. I can do a wee bit of scripting (mostly adjusting others’ work) but this is beyond me. Can you help?
Basically I need write a script to rename files in the following manner.
Keeps the original file name - say “dsc001.jpg”
Adds onto the filename part, additional data that is taken from the enclosing folder - so a file with the path
pictures/landscape/urban/london/nightscene/dsc001.jpg
is renamed to
dsc001-landscape-urban-london-nightscene.jpg
The “-” separator can be a space but bear in mind that many of my files already use the “-” in their existing filenames
I’m also using other file formats so I need to maintian the extension and not just “add” .jpg to the end of the filename.
If I can adjust how much of the path it adds (3,4,5 directory names etc) that would be useful.
Hopefully there is already a script out there, if so please let me know. Else can you help me with part or all of the scripting. ( i’m having particulare difficulty with the renaming and keeping the extension intact.
Lastly but not least. I’ve got thousands of files and so a folder action is not really going to help me (i think) Will it be possible to have a script that will just run until it’s been through all the directories in my pictures fiolder?
Hope I’ve been clear enough and you can help me out,
Regards Ray
PS. When people ask me why is the Mac so much better, I tell 'em it’s because other mac users appreciate the smart choice they made and so want to try and help them along.
Model: mac mini
Browser: Internet Explorer 5.23
Operating System: Mac OS X (10.4)