Get window from which Droplet in toolbar was launched

Is it possible to get a ref to the window from which a droplet was activated?

I’m dragging files from one Finder window to a droplet in the toolbar of another. If the droplet’s window is frontmost, getting info about the window is easy. But if the droplet’s window is behind the frontmost is there a way of identifying it? I’m specifically trying to get the name and target properties of of the target window.

TIA as usual


Experimenting a little, it seems like no way to identfy the droplet window, if you drag a file from a finder window, over to a droplet of another. As you really can’t use the layering, as windows from other applications may block it from coming forward.

I don’t know what effect you are after, or why you need this, so I can’t really give you any advice in any direction.


actually the container of the dragged file is equal to the target of its window.

Thanks for double-checking.

A Droplet can appear in every Finder window’s toolbar which makes it an interesting alternative to Folder Actions which have to be installed per folder.

The droplet I’m working on accepts folders and files and mv’s them to the Droplet’s window–which works fine when the Droplet Window is frontmost since I can tell app “Finder” to set {wName,fPath} to {get front window’s name, get front window’s target}. I then recursively process the moved folders and files (adding them to iTunes).

But if, in the course of selecting windows and so on, the Droplet Folder is one or more levels behind the frontmost, there’s no way to detect the window the Droplet was launched from, so using the frontmost window won’t work so good.

I may just have to continue to make sure my target Droplet WIndow is frontmost using eyeballs.

Yes, but I don’t care about that since I want info about the window containing the Droplet in the toolbar.


I actually think putting up a dialog with say the 5 most frontmost finder windows, for choosing the destination, is a far better idea, than being sure that the droplet window is the frontmost. But command-Z will still work, as long as you have Finder performing the moving. (Which you should for that functionality, so that you can undo the operation,should you move them to wrong place.)