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: Podcast folder size error.



On 4/29/06 4:34 PM, "Adam Bell" <email@hidden> wrote:

> --- Script Begins:
> 
> set theWay to button returned of (display dialog "Do you want to add sizes to
> folder names or remove them" buttons {"Cancel", "Remove", "Add"} default
> button "Add") 
> tell application "Finder"
>     set fldrs to folders of (selection as alias) as alias list
>     repeat with aFolder in fldrs
>         set theName to name of aFolder
>         if theWay is "Add" then
>             set mySize to (size of (info for aFolder)) / 1000 as integer
>         else
>             set mySize to 0
>         end if
>         set otid to AppleScript's text item delimiters
>         set AppleScript's text item delimiters to "["
>         set baseName to text item 1 of theName
>         set AppleScript's text item delimiters to otid
>         if mySize > 0 then
>             set nameEnd to "[" & mySize & "]"
>             set name of aFolder to baseName & nameEnd
>         else
>             if mySize = 0 then set name of aFolder to baseName
>         end if
>     end repeat
> end tel


I had trouble with an error at this line (can't make [...] into type [event
code for alias list]):

set fldrs to folders of (selection as alias) as alias list

So I changed it to this, which seemed to do what I expected it to although
the Finder selection hadn't changed:

    set thes to selection
    set fldrs to {}
    repeat with i in thes
        if kind of (info for i as alias) is "Folder" then
            set fldrs to fldrs & (i as alias)
        end if
    end repeat

Why is that? Thanks.

-- 
Laine Lee


 _______________________________________________
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: Podcast folder size error. (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.