Last active
August 3, 2018 07:56
-
-
Save pmbuko/cda49efe0699089f8e71 to your computer and use it in GitHub Desktop.
Use this code in an Applescript to create a file handler that will allow you to click on urls of the form "finder://~/Dropbox/Project/Documents" to open that location in the Finder.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on open location this_URL | |
-- passed paths should be "finder://[/path/to/directory] | |
-- spaces in path names should be replaced with a url-friendly '%20' | |
set x to the offset of ":" in this_URL | |
set passed_path to text from (x + 3) to -1 of this_URL | |
set my_path to do shell script "echo \"" & passed_path & "\" | awk '{gsub(\"%20\",\"\\\\ \"); print}'" | |
do shell script "open " & my_path | |
end open location |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment