• 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: items selected
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: items selected


  • Subject: Re: items selected
  • From: Paul Berkowitz <email@hidden>
  • Date: Sun, 23 Oct 2005 12:00:35 -0700
  • Thread-topic: items selected

On 10/23/05 11:42 AM, "Michelle Steiner" <email@hidden> wrote:

>
> On Oct 23, 2005, at 10:19 AM, Robert Poland wrote:
>
>> tell application "Finder"
>>     activate
>>     if window 1 contains items selected then beep 3
>> end tell
>
> tell application "Finder"
>      if the selection is not {} then
>          repeat with eachItem in (the selection as list)
>              set the label index of eachItem to 5
>          end repeat
>      end if
> end tell


'selection' always is a list in the Finder - no need to coerce it, and
'repeat' for an empty list does not error nor waste any time, so the 'if'
clause is not necessary. This can therefore be pared down to


tell application "Finder"
    repeat with eachItem in (get the selection)
        set the label index of eachItem to 5
    end repeat
end tell

which is more or less what Daniel sent in, give or take unnecessary
variables.

--
Paul Berkowitz


 _______________________________________________
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: items selected
      • From: Michelle Steiner <email@hidden>
References: 
 >Re: items selected (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: items selected
  • Next by Date: Re: items selected
  • Previous by thread: Re: items selected
  • Next by thread: Re: items selected
  • Index(es):
    • Date
    • Thread