diff --git a/doc/org-roam.org b/doc/org-roam.org index 20cf7c8..4879517 100644 --- a/doc/org-roam.org +++ b/doc/org-roam.org @@ -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: diff --git a/doc/org-roam.texi b/doc/org-roam.texi index ac4b2ad..d6d584d 100644 --- a/doc/org-roam.texi +++ b/doc/org-roam.texi @@ -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