Use URL Step to launch an app that does not support x-callback-urls

Hi all, first post here! So I want to launch an app called MarginNote 3 which, as far as I know, does not support x-callback-url. However, it does have its URL Scheme which is marginnote3app://. I wonder if it is possible to launch this app with the URL Step? Thank you so much!

Yeah that will work.

Sorry, my bad. I just made a test action in which there is only on URL Step to launch MarginNote 3. When I ran the action, Drafts launched MarginNote 3 with no problem. But in my previous tests, my action contains two steps. The first step runs a shortcut in the Shortcuts app and the second step attempts to launch MarginNote 3 with the URL marginnote3app://. But every time I run the action, it only performs the first step and then stops. I then tried replacing the URL marginnote3app:// with a x-callback-url gladys://x-callback-url/paste-clipboard/ and the action performs both steps perfectly.
I’m very new to Drafts and it’s very likely that I’m doing something wrong. Could you please give me a little help? Thank you so much! :stuck_out_tongue:

  1. Is there anything in the log after running the action?
  2. Is Shortcuts returning you to Drafts?
  3. Do you have “Wait for response” enabled on the Shortcuts action step?

It may also be useful if you can share your action. It often helps when trying to track down finicky issues.

Hi, thank you so much for helping!

  1. I just checked and the action log says:

Opened Callback URL: shortcuts://x-callback-url/run-shortcut?name=Drafts%20PNG&input=Quick%20test&x-success=drafts5-callback-ignore://ignore/21EDEF4A-5EB1-4BBC-B521-3DCCA99AE351&x-cancel=drafts5-callback-ignore://ignore/21EDEF4A-5EB1-4BBC-B521-3DCCA99AE351&x-error=drafts5-callback-ignore://ignore/21EDEF4A-5EB1-4BBC-B521-3DCCA99AE351&x-source=Drafts

Unable to open URL: marginnote3app://

Apparently something went wrong, but I have no idea what it is.
2. Yes, Shortcuts is returning me to Drafts after the first step, but nothing happens after that. The second step does not execute and the success message does not appear at the top of the screen.
3. No, I do not have “Wait for Response” enabled.

Here is the link to the Drafts action: https://actions.getdrafts.com/a/1PO. The first step runs a shortcut in the Shortcuts app and here is the link to this shortcut: https://www.icloud.com/shortcuts/2267c5fb01c046beb6cb201741a84128
Again, thank you so much for helping!

Try enabling the wait for response on the Shortcuts action. I suspect when it leaves Drafts it would otherwise terminate the action if it des not expect to return to Drafts.

Wow, it finally worked!! Thank you so much! Although I still wonder why the action worked when I replaced marginnote3app:// with gladys://x-callback-url/paste-clipboard. It almost seemed as if not supporting x-callback-url was the issue.
Anyway, thank you for your great help!

1 Like

x-callback-url should not make a difference…possible when you had the marginnote3app:// in there you had an extra space or something that made it an invalid URL?

Long story short on the URL handling, apps cannot open a URL when they are in the background on iOS. So, unless you wait for a response from the x-callback-url step, Drafts will error trying to open the next URL step, because it is in the background.

1 Like

Thank you for your explanation! I don’t think x-callback-url was the issue either. It is possible that I accidentally screwed up something, there’s no way to know now, haha.
P.S. I really love your apps, particularly Drafts and Terminology. Yesterday was the last day of my Drafts 5 free trial and I just subscribed to Drafts Pro :smile: Please keep up the great work!

2 Likes