Last active
August 29, 2015 14:21
-
-
Save Lokno/bfa4b2405f213f05e9d9 to your computer and use it in GitHub Desktop.
Autohotkey Script for trimming bar codes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Pause : ctrl+a, ctrl+c , delete prefix, ctrl+v | |
; Home : delete the prefix | |
; Esc : close the running script | |
prefixLength := 8 | |
codeLength := 30 | |
remainder := codeLength-prefixLength | |
TrimBarCode() | |
{ | |
global prefixLength | |
global remainder | |
clipboard := RegExReplace( clipboard, "^\d{" . prefixLength . "}(\d{" . remainder . "})$", "$1" ) | |
} | |
Esc::ExitApp | |
Pause:: | |
SendInput ^a | |
SendInput ^c | |
TrimBarCode() | |
SendInput ^v | |
return | |
$Home:: | |
SendInput {Home} | |
Loop, %prefixLength% | |
{ | |
SendInput +{Right} | |
} | |
SendInput {Backspace} | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment