DEV Community

Cover image for How to copy markdown URL and title using JXA in Raycast (JavaScript automation for macOS)
Jakub Chodorowicz
Jakub Chodorowicz

Posted on • Originally published at chodorowicz.com

How to copy markdown URL and title using JXA in Raycast (JavaScript automation for macOS)

I was looking for a script that would copy markdown formatted URL and title [Title of Page](https://url.of.page.com) from multiple browsers since I'm using different browsers regularly. This kind of script can be used standalone or in one of the macOS automation apps like Alfred or Raycast.

Raycast copy title

There are multiple examples of AppleScript, but most of them don't cater to multiple browsers. Also, as it turns out AppleScript automation is really cumbersome to work with. Its syntax was supposed to be readable, and it is, but due to that nature, it's not easy to write in. I'm not a fan of languages that try to mimic natural languages too much.

But as it turns out Since macOS Yosemite JavaScript is the first-class automation language. It's was much easier to create a more compact version of this script in markdown.

You can find the current version of the script in the following repository: chodorowicz/copy-markdown-url-and-title: Script to copy URL and title from current browser.

To add it to Raycast follow instructions detailed here: raycast/script-commands:.

Markdown copy URL and Title

Top comments (1)

Collapse
 
mattstein profile image
Matt Stein

You’ve saved me from writing my own thing and clued me into Raycast’s Script Commands as an option. Thank you!