From bd3f61dedea8eb180792e3568391a4f269849bce Mon Sep 17 00:00:00 2001 From: Jeffrey Sadeli Date: Wed, 16 Oct 2013 11:48:58 +0900 Subject: [PATCH] Update getFinder.applescript Enhanced to support Path Finder. Backward compatible with Finder. --- Create New File/getFinder.applescript | 28 +++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/Create New File/getFinder.applescript b/Create New File/getFinder.applescript index 6797d15..8c85679 100644 --- a/Create New File/getFinder.applescript +++ b/Create New File/getFinder.applescript @@ -1,9 +1,21 @@ -tell application "Finder" - try - set pathList to POSIX path of (folder of the front window as alias) - on error - set pathList to POSIX path of (path to desktop folder as alias) - end try - - return pathList +tell application "System Events" + set activeAppName to name of first application process whose frontmost is true end tell + +try + if activeAppName is equal to "Path Finder" then + tell application "Path Finder" + set pathList to the POSIX path of the target of the front finder window + end tell + else if activeAppName is equal to "Finder" then + tell application "Finder" + set pathList to POSIX path of (folder of the front window as alias) + end tell + else + set pathList to POSIX path of (path to desktop folder as alias) + end if +on error + set pathList to POSIX path of (path to desktop folder as alias) +end try + +return pathList