Re: How to naming files
Re: How to naming files
- Subject: Re: How to naming files
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 11 Dec 2000 23:33:33 -0800
On 12/11/00 11:04 PM, "Peter Mathiessen" <email@hidden> wrote:
>
Hi,
>
>
I got several files that I need to name like this: 001_001
>
>
My problem is how to make a script that counts and will name the files like
>
this: 001_001, 001_002, 001_003 and so on. If the files reach 001_999 the
>
script should continue with 002_001 ans so on.
>
Assuming you want to be able to continue in sequence when running the script
many times:
property x : 1
property y : 1
tell application "Finder"
-- define a group of files as theFiles in some way
repeat with aFile in theFiles
set n to (text -3 thru -1 of ("00" & y)) & "_" & (text -3 thru -1 of
("00" & x))
set x to x + 1
if x = 1000 then
set x to 0
set y to y + 1
end if
set name of aFile to n
end repeat
end tell
--
Paul Berkowitz