Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- These properties are meant to be editable by you.
- property emacsClientLocation : "/usr/local/Cellar/emacs/HEAD-9f56d04/bin/emacsclient"
- property emacsSocketLocation : "/var/folders/r5/bvgmmyp57397sx47ftscn7sm0000gn/T/emacs501/server"
- -- Beyond this point, there be dragons. Proceed at your peril. --
- on open location thisURL
- set urlString to decodeText(thisURL)
- set pageTitle to decodeText(getPageTitle(thisURL))
- set emacsSocketLocationParam to "-s " & emacsSocketLocation & " "
- set theCommand to emacsClientLocation & " " & emacsSocketLocationParam & (quoted form of thisURL) & " > /dev/null 2>&1 &"
- try
- set result to do shell script theCommand
- on error number exitCode
- display notification "emacsclient exited with code " & exitCode
- end try
- display notification "Saved \"" & pageTitle & "\""
- if urlString contains "capture" then
- if application "Emacs" is running then
- tell application "Emacs" to activate
- end if
- end if
- end open location
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement