Skip to content

Instantly share code, notes, and snippets.

@IAmJSD
Created July 22, 2018 12:41
Show Gist options
  • Save IAmJSD/5b54e10bc1a1d4daca126d7fdb2b2d8a to your computer and use it in GitHub Desktop.
Save IAmJSD/5b54e10bc1a1d4daca126d7fdb2b2d8a to your computer and use it in GitHub Desktop.
Saves a file in PyCharm and commits/pushes to Git
^]::
WinGetActiveTitle, WindowName
If InStr(WindowName, "PyCharm") {
Send, ^s
RegExMatch(WindowName, "[A-Z]:\\(([a-zA-Z0-9\.]){1,}(\\){0,}){1,}", FoundRegex)
if FoundRegex {
FormatTime, PCTimeFormatted
ToRun := "git.exe commit -a -m " . """" . "Save and commit from Jake's AHK script [PC time/date " . PCTimeFormatted . "]" . """"
RunWait, %ToRun%, %FoundRegex%, Hide
Run, git push, %FoundRegex%, Hide
} else {
MsgBox, Could not find the folder.
}
} else {
MsgBox, This script requires PyCharm to work.
}
Return
; Saves/commits/pushes work to Git.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment