Pasting a Tab space

Get help with using AutoHotkey and its commands and hotkeys
Redbird
Posts: 8
Joined: 03 Jun 2019, 17:25

Pasting a Tab space

23 Nov 2019, 02:17

Let's say I need to make it so that whenever I press Alt + A, my script pastes a Tab space in the current text editor. I tried this code, but it doesn't paste anything:

Code: Select all

!A::
{
	Clipboard = %A_Tab%
	Send ^v
}
How can I get this to work?
Last edited by Redbird on 23 Nov 2019, 07:12, edited 1 time in total.
Rohwedder
Posts: 2543
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Pasting a Tab space

23 Nov 2019, 05:57

Hallo,
Legacy assignment trims.
Try Expression assignments:

Code: Select all

!a::
Clipboard := A_Tab
Send ^v
Return
or:

Code: Select all

!a::Send,% A_Tab
or send tab key:

Code: Select all

!a::Send, {Tab}
Redbird
Posts: 8
Joined: 03 Jun 2019, 17:25

Re: Pasting a Tab space

23 Nov 2019, 07:17

Thank you. Unfortunately, those codes work in most text editors, but not in the particular program I need the function for: Onenote. The first code does nothing, the other codes create a table, which is default Onenote behavior when pressing Tab.

It seems to be Onenote's fault, though, as attempting to paste a tab space normally from another text editor (ie: without using AHK) does nothing either. However, I can copy tab spaces from Onenote itself and paste it anywhere on Onenote. I don't suppose anyone know how to mimic that behavior with AHK?
Rohwedder
Posts: 2543
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Pasting a Tab space

23 Nov 2019, 13:37

Only a try and only for OneNote:

Code: Select all

!a::Send, {LAlt Down}{Numpad9}{LAlt Up}
Redbird
Posts: 8
Joined: 03 Jun 2019, 17:25

Re: Pasting a Tab space

23 Nov 2019, 14:16

Doesn't do anything.

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], kakatto and 51 guests