Re: counter
Re: counter
- Subject: Re: counter
- From: Michelle Steiner <email@hidden>
- Date: Fri, 7 Sep 2001 07:11:46 -0700
On 9/7/01 1:47 AM, email@hidden <email@hidden>
wrote:
>
I have a script that checks a folder for files, then it moves 20 files to a
>
new folder. The script loops this way until the original folder is empty.
>
>
My problem is that I want the new folder to have a unique name, string with
>
"folder 01", "folder 02" and so on. I dont know how to script this. Somehow
>
it must check (count) the current folders and name the new folder the
>
correct number. But how is it done?
This should do it; you may have to change the variable names I used so
they don't conflict with the names you're using in the rest of your
script.
--Michelle
tell application "Finder"
set the targetFolder to item 1 of the selection
--or however you declare the target folder
set the FolderCount to count (folders of the targetFolder)
end tell
set newFolderName to "Folder 0" & (FolderCount + 1)
----------------------------------------------------------------------
| Michelle Steiner | We're not human beings having a spiritual |
| | experience. We're spiritual beings |
| email@hidden | having a human experience. |
----------------------------------------------------------------------