Re: wrong result when trying to get Selection from finder window
Re: wrong result when trying to get Selection from finder window
- Subject: Re: wrong result when trying to get Selection from finder window
- From: Brian Christmas <email@hidden>
- Date: Fri, 02 Nov 2012 21:17:47 +1100
On 02/11/2012, at 8:27 PM, Ronald Hofmann < email@hidden> wrote: I have the following in Mountain Lion and this only happens when opening a folder from the desktop or another space.
Here's how to duplicate: • Close all finder windows. • Open any folder on the desktop, a new finder window will appear. Select any file in that finder window by clicking on it once. • Open your AppleScript Editor and run the following script:
tell application "Finder" return selection end tell
The script will return only the path to the folder on the desktop, not the selected files in the finder window.
Any clues how to get the correct result?
I also tried this without success:
tell application "System Events" tell application "Finder" set theList to selection
set theText to "" repeat with myItem in theList set theText to theText & POSIX path of (myItem as text) & "\n" end repeat
return theText
end tell end tell
Greetings from Switzerland, Ronald Hofmann
---
G'day Ronald.
I've been using this since Leopard.
tell application "Finder" set newWin to make new Finder window close newWin return the selection end tell
Regards
Santa
|
_______________________________________________
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