Is it possible to get the path of the inactive Finder window?
Not the all of them, but the second one if I have two Finder windows opened?
I have the macro that copies the file from the one Finder window to another. And in the beginning I am getting the path of the second window:
Copy to another pane.kmmacros (6.1 KB)
which works but I would like to have more elegant solution if possible.
The Chat GPT created the Apple Script which doesn't work.
tell application "System Events"
tell process "Finder"
set backgroundWindows to (every window whose background only is true) -- Get all background windows
if backgroundWindows is not {} then -- Check if any background windows exist
repeat with theWindow in backgroundWindows -- Loop through background windows
set thePath to POSIX path of (target of theWindow as alias) -- Get the path
set the clipboard to thePath -- Copy the path to clipboard
end repeat
else
log "No background Finder windows found."
end if
end tell
end tell
Is it possible at all?