Re: Detect if folder is open/closed
Re: Detect if folder is open/closed
- Subject: Re: Detect if folder is open/closed
- From: Robert Poland <email@hidden>
- Date: Sat, 11 Apr 2015 10:52:12 -0600
- Z-usanet-msgid: XID159TDkq1N6112X31
> On Apr 11, 2015, at 9:29:AM, Yvan KOENIG <email@hidden> wrote:
>
>
>> Le 11/04/2015 à 16:20, Robert Poland <email@hidden> a écrit :
>>
>> Hi,
>>
>> 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.
>>
> I would use these instructions to get the path to open folders :
>
> tell application "Finder"
> set theOpenFolders to target of every window as alias list
> end tell
>
>
> Yvan KOENIG (VALLAURIS, France) samedi 11 avril 2015 17:29:08
This what I ended up with;
<script>
set scansFolder to alias "Macintosh HD:Users:rpoland:Desktop:scans~ƒ"
tell application "Finder"
activate
set windowList to name of Finder windows as text
# display dialog windowList
if windowList contains "scan" then
close window "scans~ƒ"
else
open folder scansFolder
end if
end tell
</script>
I would like to use “~/“ in set scansFolder but I’m missing something.
Robert Poland
Fort Collins CO
_______________________________________________
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