re: help...
re: help...
- Subject: re: help...
- From: Giao Nguyen <email@hidden>
- Date: Wed, 11 Apr 2001 16:01:12 -0600
hello all,
i just wanted to thank Michelle, Alex, and Bill for their suggests and
comments.
i am working on the script that Michelle had kind started for me. but i
am unble to get it to work.
the task that i was given was to sort through folders. each folder can
have many subfolders. i am to sort through and trash all the .gif,
.html, and .jpg. the .jpg files, i am to trash the ones that are very
small like less than 12K.
below is the script Michelle had kindly forward to me to work on:
on open (somefolder)
--tell application "Finder"
set startingItem to item 1 of somefolder as alias
if kind of startingItem is "folder" then
my processItems(startingItem)
else
display dialog "You must select a folder." buttons "Oh OK." default
button 1 with icon note
end if
--end tell
end open
on processItems(itemToBeProcessed)
set the testList to {".gif", "html", ".jpg", ".htm"}
tell application "Finder"
set containedFiles to every item of itemToBeProcessed whose kind is
not "folder"
set containedFolders to every item of itemToBeProcessed whose kind is
"folder"
repeat with fileToTest in containedFiles
set testFileName to the name of the fileToTest
set the fileSuffix to text -4 through -1 of the testFileName
if the fileSuffix is in the testList then
if the size of the fileToTest is less than 12000 then
delete the fileToTest
end if
end if
end repeat
repeat with folderToProcess in containedFolders
my processItems(folderToProcess)
end repeat
move containedFiles to the trash
empty the trash
end tell
end processItems
many thanks...
--
Giao Nguyen
email@hidden
Site Designer
InterVisual
Suite 200, 709 - 11th Avenue SW
Calgary, AB T2R 0E3
Phone: 403.264.9199
Fax: 403.264.9225
www.intervisual.com
"Internet Solutions Developer"