• 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: Can't get finder selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't get finder selection


  • Subject: Re: Can't get finder selection
  • From: Michelle Steiner <email@hidden>
  • Date: Mon, 21 Jan 2008 10:00:49 -0700

On Jan 21, 2008, at 8:20 AM, Robert Poland wrote:

I have a script that used to work with Tiger. Now with Leopard there are several problems. The first one is ;

As previously mentioned, finder window does not have a selection property; no window has a selection property.  The Finder itself has the selection property. Additionally, the selection could be in the desktop if the focus is the desktop instead of the window; your code needs to check for that as well.  Finally, "as list" is redundant because "selection" returns a list.

 So, your code should look something like this:

tell application "Finder"
if exists Finder window 1 then
set sel to the selection
if sel is not {} then
if sel is in items of Finder window 1 then
set x to selection
end if
end if
end if
end tell

This returns a list of Finder Objects in the front window if the selection is in the front window.

-- 
Anyone who has ever used SCSI knows there are totally valid technical reasons to sacrifice a chicken.


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Can't get finder selection
      • From: Skeeve <email@hidden>
References: 
 >Can't get finder selection (From: Robert Poland <email@hidden>)

  • Prev by Date: Re: Can't get finder selection
  • Next by Date: Re: Can't get finder selection
  • Previous by thread: Re: Can't get finder selection
  • Next by thread: Re: Can't get finder selection
  • Index(es):
    • Date
    • Thread