Renaming Folder Script

Hi,
I am looking for someone to write a simple apple script for me. I have a small graphic design firm and for each new job we make folders with in folders. Like this: 0000_new/0000_images/0000_highres/0000_filename.jpg. Each job we give a four digit number, such as 3040_jobname. So I am looking for a small script that will renumber a folder structure, all would be named as such 0000_ would be nested inside each other, so we don’t have to do it manually. I am willing to pay $50 for the script. If anyone is interested please let me know.
Thanks for your time!
Tamiko

Hi,

do you mean this?


set baseFolder to path to desktop
repeat
	set N to text returned of (display dialog "Enter a four-digit number" default answer "0000")
	try
		N as integer
		if length of N is not 4 then error "Wrong length: Please enter 4 numbers"
		tell application "Finder" to exists folder (N & "_new") of baseFolder
		if result then error "Jobfolder " & N & " already exists"
		exit repeat
	on error e number num
		if num = -1700 then set e to "Please enter only numbers (0-9)"
		display dialog e buttons {"Try it again"} default button 1 giving up after 2
	end try
end repeat
do shell script "/bin/mkdir -p " & quoted form of POSIX path of baseFolder & N & "_new" & "/" & N & "_images" & "/" & N & "_highres/"

you have to enter a 4-digit number and the script creates the folder structure 0000_new/0000_images/0000_highres/ on desktop

Hi Stefan,
Thanks for your post. I’m sorry if I wasn’t clear.
Our folder structure is as such.
0000_new inside that are a number of folders all starting with 0000_. Inside those folders are more folders all starting with 0000_. Inside those folders are documents that all start with 0000_. So what we are trying to do is renumber all the pieces that start with 0000_.

Thanks,
Tamiko

sorry, still not clear enough.

You want to specify a base folder and the 4-digit number (e.g. 1234) and all entire items in that base folder which start with 0000_ should be renamed to 1234_ ?

Stefan,
Thank you for your help!
Tamiko

You’re welcome :slight_smile: