(docs): added instructions on troubleshooting org-protocol (#1914)

Co-authored-by: Leo D'Angelo <ldangelo@mac.com>
This commit is contained in:
Jethro Kuan
2021-10-21 15:19:13 +08:00
committed by GitHub
parent 852042436e
commit c8f8c3e876
2 changed files with 56 additions and 0 deletions

View File

@ -909,6 +909,29 @@ defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandle
Then restart your computer.
**** Testing org-protocol
To test that you have the handler setup and registered properly from the command
line you can run:
#+begin_src bash
open org-protocol://roam-ref\?template=r\&ref=test\&title=this
#+end_src
If you get an error similar too this or the wrong handler is run:
#+begin_quote
No application knows how to open URL org-protocol://roam-ref?template=r&ref=test&title=this (Error Domain=NSOSStatusErrorDomain Code=-10814 "kLSApplicationNotFoundErr: E.g. no application claims the file" UserInfo={_LSLine=1489, _LSFunction=runEvaluator}).
#+end_quote
You may need to manually register your handler, like this:
#+begin_src bash
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -R -f /Applications/OrgProtocolClient.app
#+end_src
Here is a link to the lsregister command that is really useful: https://eclecticlight.co/2019/03/25/lsregister-a-valuable-undocumented-command-for-launchservices/
*** Windows
For Windows, create a temporary ~org-protocol.reg~ file:

View File

@ -149,6 +149,10 @@ Installation
* Mac OS::
* Windows::
Mac OS
* Testing org-protocol::
The Templating System
* Template Walkthrough::
@ -1320,6 +1324,35 @@ defaults write com.apple.LaunchServices/com.apple.launchservices.secure LSHandle
Then restart your computer.
@menu
* Testing org-protocol::
@end menu
@node Testing org-protocol
@unnumberedsubsubsec Testing org-protocol
To test that you have the handler setup and registered properly from the command
line you can run:
@example
open org-protocol://roam-ref\?template=r\&ref=test\&title=this
@end example
If you get an error similar too this or the wrong handler is run:
@quotation
No application knows how to open URL org-protocol://roam-ref?template=r&ref=test&title=this (Error Domain=NSOSStatusErrorDomain Code=-10814 ``kLSApplicationNotFoundErr: E.g. no application claims the file'' UserInfo=@{@math{_LSLine}=1489, _LSFunction=runEvaluator@}).
@end quotation
You may need to manually register your handler, like this:
@example
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -R -f /Applications/OrgProtocolClient.app
@end example
Here is a link to the lsregister command that is really useful: @uref{https://eclecticlight.co/2019/03/25/lsregister-a-valuable-undocumented-command-for-launchservices/}
@node Windows
@subsection Windows