Option to disable automatic copy to clipboard when using Insert/Type/Paste Custom text.

(@Andreas_Hegenberg I'm happy to implement a workaround if you have a suggestion as an alternative to this potential feature; you've suggested great workarounds in the past.)

Usage

I have a BTT keyboard shortcut of ⌘ + K in Atom text editor to generate markdown hyperlink syntax. The shortcut action is Insert/Type/Paste Custom Text, and pastes the following:
[(BTT)@selection(BTT)]()
The action moves the cursor 1 character to the left after pasting so that I'm in place to add the URL.

The trouble is, this action saves this chunk of text— [selection]() —to the clipboard, so if I'd previously copied the URL, it's no longer available for quick paste (instead requiring opening the clipboard manager, etc.).

Request: Can an option be added to this action to not save the pasted text to the clipboard?

Stipulations

Of course the current behavior is understandable, seeing as how the action says "paste", after all. However, if I change the action to instead use "Insert Text by Typing", for some reason it types [selection]()] (note the extra closing bracket).
...I'm wondering if this would better have been filed as a bug report on that item, then I could simply use "Insert Text by Typing" and not worry about the clipboard at all :slight_smile: [EDIT: see my followup reply for details]

I know I could use a follow-up action of Paste specific items from Clipboard Manager, but I don't always have the URL copied beforehand, and I'd rather not set that up as an independent shortcut either, as ⌘+V is so ingrained and natural. My mind doesn't inherently recognize Insert/Type/Paste Custom Text as having copied anything to the clipboard, so the most recent item in my head is the last item I explicitly copied.

Possible Workarounds

  • use a series of actions—Save selected text to variable selected_text and others—to implement this through a different path. Indeed, this will be my approach (and may be perfectly fine), outside of more efficient suggestions.
  • Open to suggestions of other workarounds.

Conclusion

If this warrants legitimate consideration as a feature—excellent! If not, I'll adapt and carry on just fine :slight_smile: Also, if you'd like me to convert this to a bug report for the "Insert Text by Typing" issue mentioned above, let me know! [EDIT: see my followup reply for details]

Thanks!

Oohhhhhhh... I think I know why "Insert Text by Typing" wasn't working. It's because of Atom's autocompleting the bracket pair that was started with the [. That's why there was the closing bracket appearing, not due to BTT :slight_smile:

Once I realized this, I was able to counteract it in my current workaround (see below). The feature request is still valid perhaps, but with this workaround it's less urgent for me, at least.


Action 1: Save selected text to variable selected_text
Action 2: Run AppleScript

tell application "BetterTouchTool"
	set selectedText to get_string_variable "selected_text"
	tell application "System Events"
		keystroke ("[" & selectedText & "]()")
		key code 124 # right arrow, to get outside the automatically included closing bracket
		key code 51 # delete key, to delete the extra closing bracket
		key code 123 # left arrow, to position inside the parentheses
	end tell
end tell
Imprint | Privacy Policy