Re(2): Folder size
Re(2): Folder size
- Subject: Re(2): Folder size
- From: "Mike Wendelken" <email@hidden>
- Date: Mon, 01 Mar 2004 19:22:00 -0600
email@hidden writes:
>
Hi Mike,
>
>
Here's a script I wrote not too long ago. It does somewhat what you
>
wanted
>
but may have to be modified.
>
>
Hanaan
>
>
script:
>
------
>
set max_folder_size_in_mb to 1
>
set images_folder to "path:to:Original:"
>
set archive_folder to "path:to:archive:"
>
set subfolder_counter to 1
>
tell application "Finder"
>
repeat until (count files in folder images_folder) is 0
>
set folder_name to "folder " & 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
>
move file fileName of folder images_folder to archive_sub_folderend
>
repeatset
>
subfolder_counter to subfolder_counter + 1
>
end repeat
>
end tell
>
------
>
>
>
>
> I would like to know if I can applescript a large size folder into
>
smaller
>
> folders. I would like to do this so it can accommodate the size of a
>
> 700mg CD. Is there a way that the folder structure can stay in tack when
>
> switching from new folder to new folder. Any help or direction will be
>
> greatly appreciated.
>
>
>
> 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.
>
>
>
>
>
Thanks for the script. Is it OK if i post for someone to help me with
folders that are nested. I'll be using you script as a example . I will
give your name in the post.
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.