counter
counter
- Subject: counter
- From: email@hidden
- Date: Fri, 7 Sep 2001 10:47:56 +0200
Hi,
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?
Please anyone....
Peter
The scipt so far:
copy "Macintosh HD:Count_and_move_files:" as text to the_vol
tell application "Finder"
set searchFolder to (the_vol & "in:")
set myList to list folder alias searchFolder without invisibles
repeat with myFilename in every item in myList
set myFile to alias (searchFolder & myFilename)
move myFile to alias (the_vol & "temp:")
set countfolder to alias (the_vol & "temp:")
set foldercount to the count of every item of countfolder
if foldercount = 20 then
set dest_folder to alias (the_vol & "collect:")
make new folder at dest_folder
---- Want a number count here, 01, 02, 03 and so on.
set time_name to current date
set searchFolder_1 to alias (the_vol & "collect:")
set myfolderList to list folder searchFolder_1 without
invisibles
repeat with myfoldername in every item in myfolderList
set myFolder to alias (the_vol & "collect:" &
myfoldername)
end repeat
move every file of alias (the_vol & "temp:") to myFolder
end if
end repeat
end tell