Selection of Finder's Second Window (Dave Lyons?)
Selection of Finder's Second Window (Dave Lyons?)
- Subject: Selection of Finder's Second Window (Dave Lyons?)
- From: Daniel Jalkut <email@hidden>
- Date: Thu, 29 Dec 2005 19:14:09 -0500
This is probably a Dave Lyons question, but I will be happy to hear
an answer from anybody :)
I've used the Finder's "selection" property innumerable times to
write very useful scripts that operate on the selection in the
frontmost window.
Is there a way to ask the Finder what the selection is a window other
than the frontmost one? I was hoping for something like this:
items of window 2 whose selected is true
But I see there is no selected property of items. There is clearly a
selected state, because I can see the selection status of those items
in the secondary window. They will become "selection" when I switch
focus to that window.
The reason I want to do this is because I have an idea for a script
that will take a file from the front window and a file from the
second window and do a "FileMerge" on them.
A sick workaround is to temporarily switch the front window out to
get the second window's selection:
tell application "Finder"
set file1 to item 1 of (selection as list)
set index of window 2 to 1
set file2 to item 1 of (selection as list)
set index of window 2 to 1
display dialog (file1 as string) & "/" & (file2 as string)
end tell
Is there a cleaner way?
Thanks!
Daniel
_______________________________________________
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