• 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: Podcast folder size error.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Podcast folder size error.


  • Subject: Re: Podcast folder size error.
  • From: Laine Lee <email@hidden>
  • Date: Sat, 29 Apr 2006 23:30:38 -0500
  • Thread-topic: 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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Podcast folder size error.
      • From: Shane Stanley <email@hidden>
    • Re: Podcast folder size error.
      • From: Shane Stanley <email@hidden>
References: 
 >Re: Podcast folder size error. (From: "Adam Bell" <email@hidden>)

  • Prev by Date: Re: Stopping dialogue window from appearing on launch
  • Next by Date: Fwd: Podcast folder size error.
  • Previous by thread: Re: Podcast folder size error.
  • Next by thread: Fwd: Podcast folder size error.
  • Index(es):
    • Date
    • Thread