Move selected text to the left or right

Hotkeys: Alt+Left Arrow to move text to the left; Alt+Right Arrow to move text to the right. The script includes both hotkeys.

Select the text to be moved. Use the hotkey (without releasing the Alt key) to move the caret to the position where you want to paste the text. Once you're there, release the Alt key to paste the text.

!Left::
!Right::
if(!x){
send ^x
hotkey,Alt up,paste,on
x:=1
}
send % "^{" . subStr(a_thisHotkey,2) . "}"
return

paste:
hotkey,Alt up,paste,off
x:=0
send ^v
return