Keyboard shortcut for links


#1

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).


Add the universal ctrl+k to shortcut for URLs
#2

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


#3

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.


#4

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

Speaking of WYSIWYG, the forums have this too!


#5

مرحبا


#8

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.


#9

@Erica Wanted to bump this !


#10

+1 for CTRL-K shortcut ! It’s definitely a missing feature… :frowning:


#11

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!


#12

Same here. I would use it regularly too.


#13

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


#14

@George3, 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: