I have a file structure for photos which is Year >Date, then within each date folder I have RAW images plus a folder named 'jpg', which contains jpg copies of the RAW files.
I need to move the jpg folders to a new location, but rename them first, to the name of the first file in the folder, which is always a descriptor, so from 'jpg' to 'Jack and Jill-1.jpg'
Once I've renamed all of the folders, (10 years of photos), I can strip out the extension and number leaving me with a folder called 'Jack and Jill'
I'm an absolute newbie with AppleScript, but have a script that works in a sense as in it performs perfectly on a test folder on my Desktop, but I can't get it to run on a mounted drive, or my network drive.
The script I've butchered is possibly carrying excess baggage and can be trimmed down, but I'm really looking for function over form as it only has to run once.
The script is purely for the initial rename, I have the extension removal side working okay via Better Rename.
tell application "Finder" -- Defining Pro Folders set pro_folder to folder POSIX file "/Users/JeffOliver/Desktop/photo" set all_pro_folders to every folder of pro_folder -- Iterate through folders and check if folder name is greater than one character repeat with parent_folder in all_pro_folders set counter to 0 -- reset a counter variable we use for the end of the name set child_folders to every folder of parent_folder repeat with current_folder in child_folders set fold_name to the name of current_folder log (fold_name) if (the length of fold_name < 8) then -- this will allow names > 9 set counter to counter + 1 -- increment the counter every time we find valid folder set new_name to name of first file of current_folder log (new_name) set the name of current_folder to new_name end if end repeat end repeat end tell
Any help in getting this to work on a network drive is greatly appreciated