Re: Automator and AppleScript to filter files > 10 Mb
Re: Automator and AppleScript to filter files > 10 Mb
- Subject: Re: Automator and AppleScript to filter files > 10 Mb
- From: "Stockly, Ed" <email@hidden>
- Date: Mon, 15 Mar 2010 17:12:35 -0700
- Thread-topic: Automator and AppleScript to filter files > 10 Mb
> My little problem I would like to to make a folder action to get an alert
window when the file is bigger or equal to 10 Mb.
This doesn't involve Auotmator. I wasn't clear if you wanted to know if the
sum of all files added is bigger than 10 megs, or if any single file is
bigger than 10 megs, so the script below checks both.
HTH,
ES
on adding folder items to this_folder after receiving added_items
tell application "Finder"
set totalSize to 0
repeat with thisItem in added_items
set totalSize to (physical size of thisItem) + totalSize
end repeat
if totalSize -1 > 10 * 1000 * 1000 then
activate
display dialog "Ce fichier fait plus de 10 Mb" with icon stop
end if
--or if you want to know if a single file is larger than 10 megs
repeat with thisItem in added_items
set itemSize to (physical size of thisItem)
if itemSize -1 > 10 * 1000 * 1000 then
activate
display dialog "Ce fichier fait plus de 10 Mb" with icon
stop
end if
end repeat
end tell
end adding folder items to
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden