Macro to Traspose Characters
Posted: 2007-08-07 13:13:19
I want to write a macro where it changes the order of two letters. So if the cursor is between the 't' and 'h' in the word 'the' and I trigger the macro, the word will change to 'hte'.
I have written the following macro:
I get an error because evidently you can't use negative numbers. So how do I move backwards one space? I am trying to do this without perl if I can so I can keep it simple and understand what I am doing.
Thanks for your help.
I have written the following macro:
Code: Select all
$locationofcursor = selection location
Select Start
Set Selection $locationofcursor, 1
Cut
set selection location -1
Set Selection $locationofcursor , 1
Paste
Select End
Thanks for your help.