Unfortunately not; I am trying another way, and maybe this forum can help with my struggle: Tana does support a “Copy link to” function in-app; one can invoke a command palette using CMD+K
, which pops up a modal window, and then type the string “Copy link to” followed by Enter, and a parseable “Title (URL)” is sent to the clipboard.
I am using a Hookmark script to invoke this, and I am able to automate this using AppleScript (sending keystroke
s) but what I am finding is the command palette does not reliably open; when this happens, the keystrokes get sent into the Tana app’s UI (which is bad lol).
Can I use AppleScript within a Hookmark script to see if the command palette window has successfully opened?
Here’s the script:
set the clipboard to ""
delay 0.5
tell application "System Events" to tell process "Tana"
keystroke "k" using {command down}
delay 1
# Problem: CMD-K sometimes doesnt do anything
keystroke "Copy link (HTML formatted)"
key code 76
delay 1
set copiedUrl to the clipboard
end tell
#TODO parse the copiedUrl into markdown and `return` it
Thank you. btw this isn’t “production” software, and so I don’t at all mind using a half-baked url scheme; goodness knows I write half baked software 4 out of 5 days per week