エラーの原因が同じ作成日の物が存在すると仮定して。
on open fileList
tell application "Finder"
repeat with i in fileList
set cDate to creation date of i
set cDate to cDate as string
set fName to word 1 of cDate & word 3 of cDate & word 5 of cDate & word 7 of cDate & word 8 of cDate
try
set name of i to fName & ".jpg"
on error number errnum
if errnum = -48 then
set a to 97
repeat
set b to ASCII character a
try
set name of i to fName & b & ".jpg"
exit repeat
on error
set a to a + 1
end try
end repeat
end if
end try
end repeat
end tell
end open
これで同じ日付けの物があると、末尾にaから順番にふっていきます。
on open fileList
tell application "Finder"
repeat with i in fileList
set cDate to creation date of i
set cDate to cDate as string
set fName to word 1 of cDate & word 3 of cDate & word 5 of cDate & word 7 of cDate & word 8 of cDate
set a to 97
repeat
set b to ASCII character a
try
set name of i to fName & b & ".jpg"
exit repeat
on error number errnum
if errnum = -48 then
set a to a + 1
else
exit repeat
end if
end try
end repeat
end repeat
end tell
end open
こっちは、どうせなら最初から末尾にaから順番にふってしまうバージョン。
しかし、ドワーフさんが紹介しているものの方が、細かい設定が出来るので使いやすそう。
お礼
みなさんスゴイ!出来ました。有り難うございました。 いやー頭がいいと便利ですね。