Last active
August 22, 2019 17:48
-
-
Save JamoCA/94f3eae71c2d7cc52682f62c7cd3e984 to your computer and use it in GitHub Desktop.
AutoHotKey script to prepends a prompted tablename variable to a list of SQL field names or variables from the clipboard.
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
; 20190822 https://gamesover2600.tumblr.com/post/187192578144/sql-macros-using-autohotkey-windows | |
; CTRL+Q prepends a tablename to list of SQL field names or variables from the clipboard. | |
; (Copy the column names from a query and this script will remove extra spaces and prepend user-defined tablename to each column.) | |
^q:: | |
InputBox, UserInput, Prepend Scope To List, Enter variable scope., ,300 ,125 , , , ,2147483, a | |
if ErrorLevel | |
RETURN | |
else | |
AutoTrim, on | |
string = %clipboard% | |
string := RegExReplace(string, "\t", "") | |
string := RegExReplace(string, "(\s)+", " ") | |
newScope := A_Space UserInput "." | |
string := StrReplace(Trim(string), A_Space, newScope) | |
clipboard := Trim(newScope string) | |
SendInput ^v | |
RETURN | |
#IfWinActive |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment