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???




Hi Adam,

Thanks for responding.

Matey, I tried your code and it works if I choose the "Originals" folder directly but it still fails when I incorporate it into my handler.

OK I just got it working...

I changed OrigFldr to PickFolder in the line:
set S to (size of (info for PickFolder)) div 1048576
and it worked so I figured the issue was in the set ProdFldr... and set OrigFldr... lines.

I then added "as alias" to the end of these lines and it now works.

Here's the working version:

on run
        set PickFolder to choose folder
        CheckOrigSize(PickFolder)
end run

on CheckOrigSize(PickFolder)
        tell application "Finder"
                set aFolder to name of PickFolder
                set ProdFldr to (first folder of PickFolder whose name contains "Production") as alias
                set OrigFldr to (first folder of ProdFldr whose name contains "Originals") as alias
                set S to (size of (info for OrigFldr)) div 1048576
                log S
        end tell
end CheckOrigSize

Many thanks!

Coj



Adam Bell <email@hidden>
Sent by: applescript-users-bounces+brett.conlon=email@hidden

06/07/06 12:00 PM

To
email@hidden
cc
Subject
Re: Check folder size - classes wrong???





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
 _______________________________________________
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: 
 >Re: Check folder size - classes wrong??? (From: Adam Bell <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.