Skip to content

Instantly share code, notes, and snippets.

@tiagofaustino
Last active March 14, 2016 14:41
Show Gist options
  • Save tiagofaustino/2587a587275276f06e81 to your computer and use it in GitHub Desktop.
Save tiagofaustino/2587a587275276f06e81 to your computer and use it in GitHub Desktop.
Script for AutoHotkey (https://www.autohotkey.com/) to Down and Up Tomcat in Eclipse IDE.
#i::UpTomcatPrincipal() ;Win+i
#k::DownUpTomcatPrincipal() ;Win+k
UpTomcatPrincipal(){
OpenEclipse()
UpTomcat()
OpenPage()
}
DownUpTomcatPrincipal(){
OpenEclipse()
DownTomcat()
UpTomcat()
OpenPage()
}
OpenEclipse(){
SetTitleMatchMode, RegEx ;
WinActivate, .* - Eclipse ; Window title must end in "- Eclipse"
Sleep, 400 ; wait 400ms
}
DownTomcat(){
send, ^3console{enter} ; Ctrl+3 and go to "Console"
Sleep, 300 ; wait 350ms
send,{AppsKey} ; Right Button
Sleep, 300 ; wait 300ms
send, n ; send "n"
Sleep, 1000 ; wait 1s
}
UpTomcat(){
send, ^+s ; Ctrl+Shift+S (Save all)
Sleep, 350 ; wait 350ms
send, ^3 ; Ctrl+3
send, ^a ; Ctrl+a
send, {Backspace} ; Backspace
send, servers{enter} ; go to "Servers"
Sleep, 350 ; wait 350ms
send, ^!p ; Ctrl+Alt+P (Publish)
Sleep, 1700 ; wait 1700ms
send, ^!d ; Ctrl+Alt+D (Debug)
}
OpenPage(){
Sleep, 12700 ; wait 12s (time my project delay)
SetTitleMatchMode, RegEx ;
WinActivate, .* - Mozilla Firefox ; window title must end in "- Mozilla Firefox";
Sleep, 400 ; wait 400ms
send, ^localhost{enter} ; enter your site
Sleep, 400 ; wait 400ms
OpenEclipse()
Return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment