With the Agenda app, I can copy a note's URL via a menu command. When I paste the clipboard into a plain text app or in Word, I get the following:
agenda://note/D56C6253-B417-4808-94D4-1C49F30709A5
However, when I view the clipboard via KM, I get some styled text--the name of the note as a hyperlink.
I have tried to use a macro found here for pulling out the URL from an HTML link, but I think maybe the link provided by agenda is not HTML but something else? I don't know how to determine what is being put on the clipboard beyond the agenda:// url.
Any tips on how I can extract the agenda:// url here?
Change Dates.kmmacros (14.7 KB)
gglick
October 30, 2019, 1:53am
#2
What happens when you try applying the "Remove Styles" filter to the clipboard after copying a note's URL?
the "remove styles" filter removes the hyperlink. What remains is the title of the note, but this time not underlined in blue.
derekvan:
With the Agenda app, I can copy a note's URL via a menu command. When I paste the clipboard into a plain text app or in Word, I get the following:
agenda://note/D56C6253-B417-4808-94D4-1C49F30709A5
Please don't double-post. I answered your question in your other post:
Is there some special reason you are using a KM Named Clipboard?
If the data you want is plain text, then it is almost always better to save it to a KM Variable . If you save it as a Global Variable then it will be available to all macros, and even across Mac restarts (just like files).
So, instead of this:
[image]
use this:
[image]
That should set the KM Variable "Agenda_URL" to the URL:
agenda://note/D1BC0274-50D9-45B4-9222-D5EE79D42782
You will need to adjust your Macro to use this K…
I will close this topic as a "dup". All further replies should be made to the above topic.