First and foremost, the code I am having issues with is:
Code: Select all
#Requires AutoHotkey v2.0
SetKeyDelay(50)
; Setup File
Alt & Numpad0::
{
Send("public class TEMP() {{}`n")
Send("`t/* ------- ESTABLISH CLASS INSTANCE VARIABLES ------- */`n")
Send("`n`n`n`n`n`n`n")
Send("/* ------- CONSTRUCTORS ------- */`n")
Send("`n`n`n`n`n`n`n")
Send("/* ------- GETTERS ------- */`n")
Send("`n`n`n`n`n`n`n")
Send("/* ------- SETTERS ------- */`n")
Send("`n`n`n`n`n`n`n")
Send("/* ------- METHODS ------- */`n")
Send("`n`n`n`n`n`n`n")
Send("/* ------- HELPER METHODS / STATIC METHODS ------- */`n")
Send("`n`n`n`n`n`n`n")
Send("/* ------- TESTER METHOD ------- */`n")
Send("`tpublic static void main(String[] args) {{}`n")
Send("`t;`n")
Send("`b{}}`n")
Send("`b`b{}}")
}
A.) My first issue is that after I run the macro my computer seems to think the alt key is being held down. I have tried running Send("{alt}") and Send("{alt up}") at the end of the macro but neither have worked. Because of this, I am unable to type or delete anything until I manually hit the alt key. Nothing too major, but it is annoying me quite a lot.
I also have a few questions.
1.) Is there any way for me to reduce the "`n" so I don't need to have 7 of them typed out to ensure 7 lines of space between my labels?
2.) I was having issues with send not outputting the correct values until I put in SetKeyDelay(50) at the top, but is 50 overkill to solve this issue? (Ex: "()" from the first send was occasionally sent as "90" and rarely a few characters would not be typed and then randomly rematerialize somewhere else after another few Send()s were run).
3.) I am currently using a Send() statement for each line of code and/or comment in my Java file template. Is there way way for me to condense this into one Send() without condensing all the strings into a single line (I still want to be able to easily read it)?