I'm trying to create a shortcut that will create a new note in Obsidian from the share action

I’d like to be able to share the content from an app I use as a scratch pad to Obsidian. I can share the content of the note from the app to a shortcut but I am struggling to make the shortcut work. I have attached a screenshot of the shortcut. If I run the shortcut without triggering it from a share action it prompts me for some text and it will run ok. I have attached a screenshot of the app with the share menu active to illustrate what I am trying to do I tried to attach a screenshot of the app with the share menu active to illustrate what I am trying to do, but as a first time user I’m not allowed to upload more than one image. Appreciate any help :slight_smile:
Thanks!

Welcome to the forum, @Simon_Tuck! Looking at the screenshot I think it should work but some pieces. One thing I’d change to see whether it makes any difference: I’d restrict the type of inputs from “Any” to “Text” or maybe “Text, URLs”. (Actions for Obsidian currently only supports textual information.)

I tried to attach a screenshot of the app with the share menu active to illustrate what I am trying to do, but as a first time user I’m not allowed to upload more than one image.

Adding a screenshot to a reply should work :slight_smile:

Hi @Simon_Tuck, great idea and thanks for sharing!
Just wanted to flag that the Obsidian are planning a “Mobile quick capture” function as you can see on their roadmap. Of course don’t know functionality or timeline but might be overlapping with your use case.

Hi,
Thanks for your feedback, really appreciate it. I’ve played around with the shortcut some more and restricted the input to text only, but I still can’t get the share button to do anything. If there is no input the shortcut prompts me for some input and it works fine: https://share.cleanshot.com/Q4yDBj6P2HRCnFCr7y2C.
But if I use the share button in the other app nothing happens: https://share.cleanshot.com/9WSCbNVSwLCpKxMjTlN7. The shortcut must be getting some input (otherwise it would prompt me) but other than that I can’t see where it’s failing. It would be great if there were some way of debugging a shortcut (i.e. breakpoints). Any ideas what might be going wrong?
Thanks!

Interesting behavior. :wink: For debugging, I’d strip it down to the bare minimum, like so:

When you run it as is, from the editor, it’ll ask for a text, then display the input in a dialog. When you call it from a Share sheet, it should also display the input – but if it doesn’t, then something’s amiss.

I don’t think the AFO actions are called at all, by the way. If they were, and there’d be missing parameters, they’d request that. If they were, they’d bring up Obsidian. If they’d pass faulty input to Obsidian, Obsidian would show an error.

Sidenote: If you’re interested in better logging capabilities, I recommend getting Logger for Shortcuts. MacStories did a good review a while back: Logger Is the Missing Console for Shortcuts Power Users - MacStories

Hi Carlo,
Thanks for your help and the link to the logger. I should be able to tackle this now :slight_smile:
Best
Simon

1 Like