Monday, April 11, 2016

Autohotkey Script that edits selected text without using the clipboard

Leave a Comment

I want to write an Autohotkey text to edit the text that the user selects and append four spaces at the beginning of every line.

If I would simply have a string with multiple lines the task would be easy.

I googled and found one solution at the official Autohotkey forum. That solution copies the text into the clipboard potentially deleting the clipboard content.

Is there a way to do this in autohotkey that doesn't use the clipboard where I can directly operate on the selected text?

1 Answers

Answers 1

Here is some basic Clipboard techniques:

ClipSaved := ClipboardAll   ;  Save the entire clipboard to a variable of your choice (in this case, ClipSaved).  ;  Here is where you put your code  Clipboard := ClipSaved   ;  Restore the original clipboard. ClipSaved =   ;  Free the memory in case the clipboard was very large. 

More here: https://autohotkey.com/docs/misc/Clipboard.htm

Hth,

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment