Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QuickCapture: Callback URL documentation bug #609

Open
3 tasks done
alexbartok opened this issue Dec 15, 2024 · 1 comment
Open
3 tasks done

QuickCapture: Callback URL documentation bug #609

alexbartok opened this issue Dec 15, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@alexbartok
Copy link

Checks

  • I confirm I have restarted NotePlan and this problem still persists.
  • I confirm I have reinstalled the Plugin and this problem still persists.
  • Is this a repeatable problem?

System

  • Device OS: macOS 15.1.1
  • NotePlan Version: 3.15.1
  • Plugin Name & Version: "QuickCapture" v0.16.0

Describe the bug
There seems to be a documentation bug @ https://github.com/NotePlan/plugins/blob/main/jgclark.QuickCapture/README.md :

  • The documentation provides sample callback URLs with the pretty function names urlencoded, such as noteplan://x-callback-url/runPlugin?pluginID=jgclark.QuickCapture&command=quick%20add%20to%20journal%20today
  • However, this fails with a command not found error in the logs. Instead, Noteplan expects the actual js function names in the callback URL, e.g. appendTextToDailyJournal instead of quick%20add%20to%20journal%20today
  • The docs should be updated with the Javascript function names.

Plugin Console Log

AppDelegate: handleGetURLEvent called, first checking if its for Dropbox
none
AppDelegate: handleGetURLEvent called, picking the first url: noteplan://x-callback-url/runPlugin?pluginID=jgclark.QuickCapture&command=quick%20add%20to%20journal%20today&arg0=helloworld&arg1=&arg2=&arg3=. Is the handler nil = no (cache the url if needed)
UI+URLScheme: parse incoming x-callback-url
UI+URLScheme: do something with runPlugin
Running a plugin through x-callback (["arg2": "", "command": "quick add to journal today", "pluginID": "jgclark.QuickCapture", "arg1": "", "arg0": "helloworld", "arg3": ""]
Plugin 'dwertheimer.DateAutomations' is already downloaded with the same or higher version, don't add it from the core plugins again
Found plugin: 'jgclark.QuickCapture'.
Couldn't find the command in any plugin, check for typos
AppDelegate: handleGetURLEvent called, first checking if its for Dropbox
none
AppDelegate: handleGetURLEvent called, picking the first url: noteplan://x-callback-url/runPlugin?pluginID=jgclark.QuickCapture&command=appendTextToDailyJournal&arg0=helloworld&arg1=&arg2=&arg3=. Is the handler nil = no (cache the url if needed)
UI+URLScheme: parse incoming x-callback-url
UI+URLScheme: do something with runPlugin
Running a plugin through x-callback (["command": "appendTextToDailyJournal", "arg1": "", "arg2": "", "arg3": "", "pluginID": "jgclark.QuickCapture", "arg0": "helloworld"]
Plugin 'dwertheimer.DateAutomations' is already downloaded with the same or higher version, don't add it from the core plugins again
Found plugin: 'jgclark.QuickCapture'.
Found command 'quick add to today's journal'.
initFunc result: undefined
JSLog: Executing function 'appendTextToDailyJournal'
JSLog: 2024-12-15 16:20:23 | DEBUG | jgclark.QuickCapture v0.16.0 :: starting /qaj with arg0='helloworld'
JSLog: 2024-12-15 16:20:23 | DEBUG | jgclark.QuickCapture v0.16.0 :: Adding 'helloworld' to 2024-12-15	(📆 today) under matchedHeading 'Journal'
Register: 20241215.md, update: changed, source: local
commandFunc result: Optional([object Promise])
Plugin successfully executed via x-callback
@alexbartok alexbartok added the bug Something isn't working label Dec 15, 2024
@alexbartok alexbartok changed the title <plugin name>: <title> QuickCapture: Callback URL documentation bug Dec 15, 2024
@dwertheimer
Copy link
Collaborator

@alexbartok Thx for reporting. You are correct, the docs are wrong. The command changed names awhile back but it looks like the docs were not updated to match. The correct URL is:

noteplan://x-callback-url/runPlugin?pluginID=jgclark.QuickCapture&command=quick%20add%20to%20today's%20journal&arg0=TEXT_HERE

cc: @jgclark

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants