I left the original version as a reminder. Without it I would probably forget this behavior.
set trash_loc to my getLocalizedString("Finder", "AXICON6")
set TrashFolder to path to trash
tell application "Finder"
activate
set windowList to name of Finder windows as text
log windowList
# display dialog windowList
if windowList contains trash_loc then
close window trash_loc
else
-- open folder TrashFolder # works in French but fails in English
open TrashFolder # this one works everywhere
end if
end tell
on getLocalizedString(a, x)
return localized string x in bundle path to application a
end getLocalizedString
Yvan KOENIG running Yosemite 10.10.5 in French (VALLAURIS, France) samedi 26 septembre 2015 21:03:12