• 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: KOENIG Yvan <email@hidden>
  • Date: Mon, 21 Jan 2008 17:42:40 +0100


Le 21 janv. 2008 à 16:49, Axel Luttgens a écrit :
…
--******
tell application "Finder"
    if exists Finder window 1 then -- make sure there is a window
        set wdw to Finder window 1
        tell wdw
            if selection is not {} then
                set x to selection as list
            end if
        end tell
    end if
end tell
--******


Hello Bob,

Are you sure the above worked with Tiger?

It really didn't.

tell application "Finder"
exists Finder window 1
true
get Finder window 1
Finder window id 110
get selection of Finder window id 110
"Erreur dans Finder : Impossible d’obtenir selection of Finder window id 110."



"selection" is a Finder's property, not a property of a Finder's window.
Perhaps did you mean something like this:


   tell app "finder"
       set x to selection as alias list
   end

his would work wrongly under Tiger.

The result is:

{document file "bitstream_vera_mono.zip" of folder "polices gratuites" of folder "Desktop" of folder "yvankoenig" of folder "Users" of startup disk of application "Finder", document file "bitstream_vera_seri.zip" of folder "polices gratuites" of folder "Desktop" of folder "yvankoenig" of folder "Users" of startup disk of application "Finder"}

Which is not an alias list.

I got the correct result with:

tell application "Finder"
	if exists Finder window 1 then -- make sure there is a window
		if selection is not {} then
			set x to selection
			repeat with i from 1 to count of x
				set x's item i to (x's item i) as alias
			end repeat
		end if
	end if
end tell

But, the OP was not trying to build a list of alias, only a list of files descriptors so:

tell application "Finder"
	if exists Finder window 1 then -- make sure there is a window
		if selection is not {} then
			set x to selection
		end if
	end if
end tell

would fit its needs.

Yvan KOENIG




_______________________________________________ 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
References: 
 >Can't get finder selection (From: Robert Poland <email@hidden>)
 >Re: Can't get finder selection (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: Choose from List & Return Item Number
  • 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