I notice that the existing macro for that bundleID tries the menu twice β suggesting that there had been an intemittent timing issue with it. (Bear.app may take a little time to get the link into the clipboard, for some reason)
So two steps:
Let me know if that menu path has changed (I'm not running Bear.app here at the moment)
If it hasn't, I suggest either a third click a that menu, or the insertion of a small pause, and possibly a wait until the clipboard has been updated by Bear.
Thanks to your suggestions, I managed to make it work.
Yes, the menu path is the same.
I added multiple wait for clipboard to change actions, but it still did not work.
By replacing the menu path with the copy link to note shortcut, the macro is now at least partially working.
The macro output is a functional link, but the note title is not included, for example
bear://x-callback-url/open-note?id=9358A97B-DFF9-4B24-B427-3647A858C430-92972-0000D0227DC8C270 which is functional but not ideal because the title is missing.
Would you know where in the net.shinyfrog.bear the title is added?
Curiously enough I've installed Bear.app now, and the existing sub-macro is working fine here on:
macOS 11.6.7
Bear 1.9.6 (9044)
Could you tell us a bit more about your OS version and hardware ?
I may need to put it a clipboard-clear and pause this evening. Bear seems just slightly sluggish, and it may need more time to populate the clipboard with the various different types of pasteBoard item which it puts in there. (public.utf8-plain-text, public.url, and net.shinyfrog.bear.url-name)
Just to make sure that there is no misunderstanding, I can generate a fully functional link like
bear://x-callback-url/open-note?id=03A0839A-A772-4E8C-AC8A-667FD33F7C7B-92972-0000D5FF487628A8
but that link gives me no clue as to the title of the underlying note, which defeats the purpose.
what I can't generate is the title of the note as a functional link
example
[this is a test note](bear://x-callback-url/open-note?title=this%20is%20a%20test%20note&x-error=bear%3A%2F%2Fx%2Dcallback%2Durl%2Fcreate%3Ftitle%3Dthis%2520is%2520a%2520test
%2520note)
In Bear, the only way that I can generate this is a test note is by writing the note, and drag and drag that same note from the notes list into the body of the this is a test note, and the this is a test note is generated automatically
{
"public.utf8-plain-text as string": "bear://x-callback-url/open-note?id=4865D6A6-7DBF-4E55-B6FD-EE0F46BAFC86-48921-00007C85132F55C2",
"net.shinyfrog.bear.note-uuid-pasteboard-type as string": "4865D6A6-7DBF-4E55-B6FD-EE0F46BAFC86-48921-00007C85132F55C2",
"public.url as string": "bear://x-callback-url/open-note?id=4865D6A6-7DBF-4E55-B6FD-EE0F46BAFC86-48921-00007C85132F55C2",
"net.shinyfrog.bear.url-name as string": "This is the title"
}
If you paste into a text editor, you will only see the public.utf8-plain-text, content, since that's all that a text editor can directly use, but the other pboarditems are there too, and accessible to script.
Not quite sure that I understand that either. No pause is needed after the clipboard has been populated.
Sub Macro: I had not seen your reply. I am an idiot. Terribly Sorry.
Excellent news - with the sub macro everything works, with 2 glitches:
If I run the sub macro as a stand alone, it does not work with the error message Note > Copy Link To Note not found. I simply replaced Copy Link to Note with its shortcut and it now works fine. I am extremely happy thanks to you. This is not unheard of (having to replace menu paths with native app shortcuts) and happens often for example with Scrivener.
If I run the submacro by running the Copy as Markdown link main macro, I get the following error message, probably because you have not yet linked both.
Macro UUID :: undefined
a script must be specified
One last (hopefully) question and I will leave you in peace.
In terms of workflow, I would often want to paste the markdown link (in the exact same format as that generated by your macro) of the currently selected email in apple mail, note in bear note, item in DevonThink, tab in chrome, etc
Is it conceivable to create a variant of your macro to do so ?
You might be able to β the app from which the MD link is copied needs to have focus, so I'm not sure how you would decide which app was the paste target.
Outside the scope of the Copy As MD link macro itself, but you might get somewhere by experimentation.
Now, I am getting these error messages using apple mail which I did not have before. I never had problems with apple mail using your macro previously. I restarted apple mail and checked that com.apple.mail is present and enabled in the group.
Would you have any idea how to troubleshoot the issue ?.
thank you
to allow for direct pasting of formatted links into recent builds (69+) of Jesse Grosjean's Bike Outliner.
If you want to paste the copied link into a Bike.app document in plain text Markdown [label](url) format (rather than as a blue inline link), you can use a ββ§V Paste as plain text macro like this one: