Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Opt("TrayMenuMode", 3)
- Local $SleepTime = 100
- Local $helpURL = "https://keepass.info/help/base/index.html"
- Local $KeePass[2] = ["C:\Program Files\KeePass Password Safe 2\", "KeePass.exe"]
- Local $AutoType[3] = ["-auto-type", "-auto-type-password", "-auto-type-selected"]
- Local $idKP = TrayCreateItem("KeePass")
- Local $idKPH = TrayCreateItem("KeePass Help")
- TrayCreateItem("")
- Local $idAT = TrayCreateItem("AutoType Selected")
- Local $idGAT = TrayCreateItem("Global AutoType")
- Local $idGATP = TrayCreateItem("Global PassWord")
- TrayCreateItem("")
- Local $idExit = TrayCreateItem("Exit")
- If $CmdLine[0] > 1 Then
- For $i = 1 to $CmdLine[0]
- Switch $CmdLine[$i]
- Case '-delay'
- $SleepTime = $CmdLine[$i + 1]
- Case '-path'
- $KeePass[0] = $CmdLine[$i + 1]
- Case '-name'
- $KeePass[1] = $CmdLine[$i + 1]
- EndSwitch
- Next
- EndIf
- TraySetState(1)
- TraySetIcon(@ScriptDir & '\AutoGAT.ico')
- While 1
- If Not ProcessExists($KeePass[1]) Then ExitLoop ;leaves this While loop if KeePass exits or isn't running
- Switch TrayGetMsg()
- Case $idExit
- Exit
- Case $idKP
- ShellExecute($KeePass[0] & $KeePass[1])
- Case $idKPH
- ShellExecute($helpURL)
- Case $idAT
- Send("!{TAB}")
- Sleep($SleepTime)
- ShellExecute($KeePass[0] & $KeePass[1], $AutoType[2])
- Case $idGAT
- Send("!{TAB}")
- Sleep($SleepTime)
- ShellExecute($KeePass[0] & $KeePass[1], $AutoType[0])
- Case $idGATP
- Send("!{TAB}")
- Sleep($SleepTime)
- ShellExecute($KeePass[0] & $KeePass[1], $AutoType[1])
- EndSwitch
- WEnd
- Exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement