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