• 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: Dave Lyons <email@hidden>
  • Date: Mon, 24 Oct 2005 16:35:23 -0700

On Oct 23, 2005, at 12:21 PM, Robert Poland wrote:
...
tell application "Finder" to set label index of every file of folder1 to myLabelIndex
tell application "Finder" to set label index of every folder of folder1 to myLabelIndex

It would probably be better to just ask for "every item" -- "item" is the Finder class that includes both files and folders:


tell application "Finder" to set label index of every item of folder1 to myLabelIndex

One other interesting thing: A "normal" Finder window showing the contents of a disk or folder has class "Finder window", which is a kind of "window". Getting the selection will work even if there is some other sort of Finder window open in front of the frontmost "Finder window". (The other window could be Preferences, Get Info, View Options, Clipboard, etc.)

Since you script uses "window 1" in the empty-selection case, it may try to get every item of an arbitrary kind of Finder window (which, perhaps strangely, doesn't complain...it just returns an empty list).

It would make the selection and no-selection cases more consistent to use "Finder window 1" in place of "window 1".

Cheers,

--Dave

_______________________________________________
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


References: 
 >items selected (From: Robert Poland <email@hidden>)
 >Re: items selected (From: Daniel Jalkut <email@hidden>)
 >Re: items selected (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Setting the desktop picture on second monitor.
  • Next by Date: Re: Days and hours
  • Previous by thread: Re: items selected
  • Next by thread: Re: items selected
  • Index(es):
    • Date
    • Thread