• 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
Re: Automator and AppleScript to filter files > 10 Mb
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Automator and AppleScript to filter files > 10 Mb (From: Thierry Willemsens <email@hidden>)

  • Prev by Date: Re: Automator and AppleScript to filter files > 10 Mb
  • Next by Date: Re: Automator and AppleScript to filter files > 10 Mb
  • Previous by thread: Re: Automator and AppleScript to filter files > 10 Mb
  • Next by thread: Re: Automator and AppleScript to filter files > 10 Mb
  • Index(es):
    • Date
    • Thread