Hello. Sorry to revive this old post with a somewhat unrelated question.
Is there a way to use espanso to copy two different texts and type something to paste them all at once? Here’s an example:
In Obsidian, if I wanted to link to an article or YT video, I’d type []() and copy & paste the URL into (), then do the same for the article/vid’s title in [] so that it only displays the title. But that’s twice the time and effort of copying, pasting and moving between windows.
I’ve currently set up espanso so that if I copy the article’s title and type :url in Obsidian, the output would be [{{title}}]() where {{title}} is the copied title pasted in []. I’d then manually copy & paste the URL in ().
While this is somewhat faster, it’s not that much, it still requires me to go back and forth between the browser and Obsidian windows.
I was wondering if there’s a way to copy the title first and immediately copy the URL after (or vice versa) and type :url to have espanso paste the two separate texts into the two different brackets all at once: [TITLE](URL). This requires me to only move from browser to Obsidian once.
Hope that makes sense. So far, I’ve found that you could only do this for what’s currently on the clipboard and not what was copied before it.
I know this isn’t strictly on point, but Alfred (mac app) does that and a hell of a lot more. I created a workflow that even takes a snapshot of the webpage using the Internet Archive. Glass Dome: prevent link rot inside markdown notes
Anyway, if you like the idea, maybe you can look at the code and adapt it to your software.
FWIW, to grab markdown links, eg from a browser page, I use a utility called Hook – Find without searching …I used it just now for that link.
While on browser, it’s 2 key strokes, then toggle over to Obsidian and paste yields []() properly filled in. (With Keyboard Maestro (or Alfred), you could make it 1 key stroke.)
Hook btw is designed for more than that, but it has convenient side effect of easily grabbing links as markdown.
Are you on a Mac? I’ve a simple AppleScript that I trigger with ⌘⇧C in Safari and it automatically generates the link [TITLE](URL) and put it on my clipboard. More can be done to it for example I copy a lot of YouTube links this way and remove the (20) type text which YouTube puts in the title to show notifications. This is as quick as I can get and perhaps faster than using ⌘C, which would first require me to click the address bar or use another shortcut for it.
That’s right. It’s £45 for a lifetime license, which isn’t cheap, but It’s one of the best software purchases I’ve ever made. I’ve used it so much over the past 4 years that it’s become as essential as macOS itself. I’m kind of an unpaid Alfred evangelist, these days.
My custom version includes a separate link to a file named after the week number (at the beginning of the line, since I keep a weekly to-do list that includes the daily lists), but you can just delete that first segment.
I also like having the day of the week, but you can just remove the %EEEE% to get rid of it. Thought I’d save others the unicode date math in case it’s helpful.
@chopivy, thank you so much for this - I had no idea I could combine Windows PowerShell and espanso in this way until I saw your post. Adding a day of the week calculation for Windows users, following @mitzimbj suggestions above:
Limitations: I wasn’t able to find the equivalent of @mitzimbj’s -v command for Windows, so I used an if statement instead. This means that you can’t do a properly formatted link [[2020-07-20 | Monday 20 July, 2020]] as PowerShell throws an error when you try and open a second pipe | (Get-Date) inside the if and else curly { } braces. If anyone knows of a more elegant solution, I would love to hear it.
In situations where today is Monday and I want to fast-forward by a week instead (i.e. Monday > Monday) I use the # Next Week script:
So it matches by Odisidian daily notes pattern. However, when I run the script, the weekday is in lowercase, so instead of Mon I get mon, different from Obisidian behavior.
I tried to the code with breadcrumb (bc) - powershell started, then nothing happens, breadcrumb is not appearing, just blank page. Any ideas why could it happen?
Hey @trickykid, Bash and (Windows) PowerShell are similar in ways but not identical, thus you should use different syntax (?)/functions. The following espanso command works for me on Windows 10: