• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Where is Trash Folder(?)?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Where is Trash Folder(?)?
      • From: Robert Poland <email@hidden>
References: 
 >Where is Trash Folder(?)? (From: Robert Poland <email@hidden>)

  • Prev by Date: Where is Trash Folder(?)?
  • Next by Date: Re: Where is Trash Folder(?)?
  • Previous by thread: Where is Trash Folder(?)?
  • Next by thread: Re: Where is Trash Folder(?)?
  • Index(es):
    • Date
    • Thread