Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Check folder size - classes wrong???



Title: Re: Check folder size - classes wrong???
Hiya,

Adding further to my archive checking script I want to test the size of a folder to flag it if it is higher than a specific size.

Here's an extract of my larger script of what I have but I get the below error. The "size checking" line is taken from an email Adam Bell posted to the list some time back:

on open folderList
        repeat with PickFolder in folderList
                CheckOrigSize(PickFolder)
        end repeat
end open

on CheckOrigSize(PickFolder)
        tell application "Finder"
                set aFolder to name of PickFolder
                set ProdFldr to first folder of PickFolder whose name contains "Production"
                set OrigFldr to first folder of ProdFldr whose name contains "Originals"
                if ((size of (info for OrigFldr)) div 1048576) > 5 then beep 5
        end tell
end CheckOrigSize

We can't see what PickFolder will be, but it needs to be a complete path to the folder in question, i.e.: OrigFldr has to be a complete path.

e.g. this works:

set F to (choose folder)
tell application "Finder" to set S to (size of (info for F)) div 1048576

Adam


info for folder "Originals" of folder "3. Production" of folder "Job D11111 D22222 D52518 Davids Folder Template" of disk "TECH"
                "Finder got an error: File folder Originals wasn't found."

The File part worries me that I have my classes mixed up but I'm not sure how to resolve it.

I tried getting the properties of the folder but it said that the size value was missing...

As always, help is highly appreciated!

Cojcolds

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/bellac%40accesscable.net

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-users/email@hidden

This email sent to email@hidden

References: 
 >Check folder size - classes wrong??? (From: Brett Conlon <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.