Change Photo Name
Change Photo Name
- Subject: Change Photo Name
- From: email@hidden
- Date: Tue, 11 Sep 2001 15:19:17 EDT
Thanks to Paul Skinner and all the others who responded to my initial cry for
help. I now have a script that ALMOST works. It will give the correct RESULT,
but it will not actually change the name of the photo in the folder. Sure
could use a little more help.
In a folder there are hundreds of photos, sample names are shown below.
Bonanzaville 02218.jpg
Clouds 00659.jpg
Curio Cabinet 00418.jpg
Dakota Bus College 02303.jpg
This is how I want the name of photo in the folder to look.
02218 Bonanzaville.jpg
00659 Clouds.jpg
00418 Curio Cabinet.jpg
02303 Dakota Bus College.jpg
Below is what I have now.
--begin script
set fileList to list folder (choose folder with prompt "Where are the files
man?") as text
repeat with thisName in fileList
set text item delimiters to "."
set thisName to item 1 of every text item of thisName
set text item delimiters to " "
set fileNumber to text item -1 of thisName
set text item delimiters to ""
set fileName to characters 1 thru -((length of fileNumber) + 2) of
thisName as text
set newName to fileNumber & " " & fileName & ".jpg "
end repeat
--end script