Keyboard shortcut for links

Iā€™d like to be able to select some text, hit a keyboard shortcut, and have a pop-up appear (similar to the date picker) that lets me enter a URL. The output would be [text](url).

10 Likes

I think this feature request falls under the larger scope of a WYSIWYG editor.

1 Like

It would definitely be solved by the WYSIWYG editor feature, but I think it can also be itā€™s own very small feature that would save a lot of time. Pasting links is pretty time-consuming. The existing functionality is great, but Iā€™d just love the shortcut that Ken is describing.

1 Like

Absolutely. ctrl+k (the universal command) works for the forums even!

Speaking of WYSIWYG, the forums have this too!

1 Like

Ł…Ų±Ų­ŲØŲ§

My usual use case: select some test, hit Cmd-K, expect it to get surrounded by [ and ]()m and for my cursor to get moved to in between the parentheses.

@Erica Wanted to bump this !

+1 for CTRL-K shortcut ! Itā€™s definitely a missing featureā€¦ :frowning:

I would love this, as well. I came here to submit a request, and found this existing thread. Often I find myself writing the bullet point and then grabbing the link that I want to insert. Having ā€œcmd/ctrl + kā€ would be a wonderful time-saver!

Same here. I would use it regularly too.

Does anyone know how to make Alfred scripts? Or Automator scripts?

in psuedocode what you want to do is

store clipboard text as var1
copy highlighted text
[
paste
]
(
paste var1
)

And trigger this via ctrl+K

I am not personally very familiar with automator programming so if anyone posts their code I will love you

@BigChungus, here is the AppleScript I use:

tell application "Dynalist"
    activate
    
    # Save current clipboard (=url) to a variable
    set theUrl to the clipboard
    delay 0.1
    
    # Copy selected text to clipboard
    tell application "System Events" to keystroke "c" using {command down}
    delay 0.1
    
    # Write the anchor text in []
    tell application "System Events" to keystroke "["
    delay 0.1
    tell application "System Events" to keystroke "v" using {command down}
    delay 0.1
    tell application "System Events" to keystroke "]"
    delay 0.1

    
    # Write the url in ()
    set the clipboard to theUrl
    delay 0.1
    tell application "System Events" to keystroke "("
    delay 0.1
    tell application "System Events" to keystroke "v" using {command down}
    delay 0.1
    tell application "System Events" to keystroke ")"
end tell

I invoke the script with an Alfred workflow that has the hotkey cmd+K as a trigger.

You just copy the url to your clipboard, select the text you want to turn into a link and press cmd+K. Done. :slight_smile:

Added in the latest version of Dynalist.

2 Likes

Thank you!

1 Like