Re: Where is Trash Folder(?)?
Re: Where is Trash Folder(?)?
- Subject: Re: Where is Trash Folder(?)?
- From: Yvan KOENIG <email@hidden>
- Date: Sat, 26 Sep 2015 19:41:27 +0200
Le 2015/09/26 à 19:34, Robert Poland < email@hidden> a écrit :
Hi,
I’m trying to create a script, below, that I can add to a Keyboard Maestro shortcut. This script works with normal folders but “Trash” doesn’t seem to have a home.
Any thoughts/suggestions?
(* openTrashContainer - 9/26/15 - By R L Poland *)
tell application "Finder" activate set TrashFolder to (path to Trash folder) set windowList to name of Finder windows as text # display dialog windowList if windowList contains "Trash" then close window "Trash" else open folder TrashFolder end if end tell
TIA,
(1) path to is not a Finder command but a Standard Additions one.
(2) It seems that you failed top look in Standard Additions dictionary.
There is no " path to trash folder" command, just a " path to trash" one.
Taking care of that, it's easy to build a script which behave flawlessly.
set TrashFolder to (path to trash) tell application "Finder" activate
set windowList to name of Finder windows as text # display dialog windowList if windowList contains "Trash" then close window "Trash" else open folder TrashFolder end if end tell
Yvan KOENIG running Yosemite 10.10.5 in French (VALLAURIS, France) samedi 26 septembre 2015 19:41:13
|
_______________________________________________
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