Re: Detect if folder is open/closed
Re: Detect if folder is open/closed
- Subject: Re: Detect if folder is open/closed
- From: Nigel Garvey <email@hidden>
- Date: Sat, 11 Apr 2015 20:28:19 +0100
Robert Poland wrote on Sat, 11 Apr 2015 08:20:14 -0600:
>I have a Keyboard Maestro shortcut that opens a folder that resides on
the
>desktop.
>
>I would like to detect if that folder is already open and use the same
>shortcut to close it. Even if there are many other folders open.
Hi Robert.
This seems to work:
set scansFolder to ((path to desktop as text) & "scans~ƒ") as alias
tell application "Finder"
activate
set scansWindow to scansFolder's container window
if (scansWindow exists) then
close scansWindow
else
open scansWindow -- or open scansFolder
end if
end tell
NG
_______________________________________________
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