• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
nested folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nested folders


  • Subject: nested folders
  • From: "Mike Wendelken" <email@hidden>
  • Date: Mon, 08 Mar 2004 21:42:23 -0600

I received this script from one of the users in this
group(email@hidden). Which I would like to thank. But the problem is I
would like to incorporate subfolders in this script. Any help would be
appreciated.
set max_folder_size_in_mb to 660
set images_folder to "LaCie:Archives:INM29148:"
set archive_folder to "LaCie:mike_ burn:"
set subfolder_counter to 1
tell application "Finder"
activate
repeat until (count files in folder images_folder) is 0
set folder_name to "splitfolder" & subfolder_counter
set archive_sub_folder to make new folder in folder archive_folder with
properties {name:folder_name}
set image_list to list folder alias images_folder without invisibles
set file_list to {}
set total_MB to 0
set file_counter to 1
repeat while ((total_MB is less than max_folder_size_in_mb))
set fileName to item file_counter of image_list
set file_size to size of (info for alias (images_folder & fileName))
set file_size_in_MB to (file_size / 1024 / 1024)
set total_MB to total_MB + file_size_in_MB
set file_counter to file_counter + 1
set fileMovin to images_folder & fileName
try
move file fileMovin to archive_sub_folder
on error
display dialog "There was a problem moving the file from/to - " & ,
images_folder & fileName & " " & archive_sub_folder ,
buttons ("Cancel") default button 1
end try
end repeat
set subfolder_counter to subfolder_counter + 1
end repeat
end tell

Michael Wendelken/TSR
Nec Inc.
345 7th Ave Suite 1101
New York,NY 10001
Phone: 646-733-9166 ext. 4009
Fax: 646-733-9178
email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: TechNote 2106
  • Next by Date: Re: The other Folder Action handlers
  • Previous by thread: cumulus 5 scripting
  • Next by thread: funny pair of scripts
  • Index(es):
    • Date
    • Thread