Skip to content

Instantly share code, notes, and snippets.

@blurymind
Last active August 17, 2016 15:10
Show Gist options
  • Save blurymind/490c7139927602c8d8c73b46bded6d0b to your computer and use it in GitHub Desktop.
Save blurymind/490c7139927602c8d8c73b46bded6d0b to your computer and use it in GitHub Desktop.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;;
;;; Sun Lotion - Data Entry Application ;;;
;;; Created by Todor Imreorov -- [email protected] ;;;
;;; For Use with SolarVista ;;;
;;; ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Gui, Add, Text, Section x50,Created by Todor Imreorov
Gui, Add, Button,gShortcutsHint ys, Shortcuts
Gui, Add, Button,gAboutHint ys, About
;Gui, Add, Text,Section
Gui, Add, Text,Section x50,----------------- SolarVista Raise: -----------------
Gui, Add, Text, Section x10,Project Code:
Gui, Add, Edit, vPrCode w50 ys,
Gui, Add, Button,gCheckPcode ys, Check ;add g prefix to button function names here
Gui, Add, Text, ys,/Task Code:
Gui, Add, Edit, vTCode w50 ys,
;Gui, Add, Text, Section, Your code:
;Gui, Add, DropDownList,YS,vColorChoice, Black|White|Red|Green|Blue
Gui, Add, Text,Section x10, Requestor:
Gui, Add, Edit, w90 vReq ys
Gui, Add, Text,Section ys, / Site ID:
Gui, Add, Edit, w50 ys vsCode
Gui, Add, Button,gFindScode ys, Find
Gui, Add, Text,Section Section x10,Req Time:
Gui, Add, Edit, w50 vReqTime ys
Gui, Add, Text,Section ys, <--- Enter manually
;Gui, Add, Text,Section
Gui, Add, Text,Section x50,-------------------- Description: -------------------
Gui, Add, Text,Section x10, FAO:
Gui, Add, Edit, w90 vFao ys
Gui, Add, Text,ys, / Start Date/time:
Gui, Add, Edit, w50 vStartTime ys
Gui, Add, Text,x150 Section, / End Date time:
Gui, Add, Edit, w50 vEndTime ys
Gui, Add, Text,Section x1,About:
Gui, Add, Edit, w280 h80 vAbout ys
Gui, Add, Button, test x1, RAISE
appLicationName = Sun Lotion 0.3
Gui,Show,autosize,%applicationName%
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Create a right click menu;;;;;;;;;;;
^\::
Send, {CTRLDOWN}c{CTRLUP}
sleep,100
;; menu entries and what they trigger ;;
Menu,Main,Add,Search For Site ID,findSite
Menu,Main,Add,Check Project Code,findProject
Menu,Main,Add,================,null
Menu,Main,Add,Set Project Code (no check),addProjectCode
Menu,Main,Add,Set Task Code (no check),addTaskCode
Menu,Main,Add,----------------,null
Menu,Main,Add,Set Site ID (no check),addSite
Menu,Main,Add,Set Requestor,addReq
Menu,Main,Add,Set FAO,addFao
Menu,Main,Color,0xF8FF64,Single
Menu,Main,Show
return
;;;;;;;;;;;;;;;;;; MENU COMMANDS ;;;;;;;;;;;;;;;
addTaskCode:
WinActivate, %applicationName%,
GuiControl, Focus, TCode
Send, {CTRLDOWN}a{CTRLUP}{BACKSPACE}{CTRLDOWN}v{CTRLUP}
return
addProjectCode:
WinActivate, %applicationName%,
GuiControl, Focus, PrCode
Send, {CTRLDOWN}a{CTRLUP}{BACKSPACE}{CTRLDOWN}v{CTRLUP}
return
addSite:
WinActivate, %applicationName%,
GuiControl, Focus, sCode
Send, {CTRLDOWN}a{CTRLUP}{BACKSPACE}{CTRLDOWN}v{CTRLUP}
return
addReq:
WinActivate, %applicationName%,
GuiControl, Focus, Req
Send, {CTRLDOWN}a{CTRLUP}{BACKSPACE}{CTRLDOWN}v{CTRLUP}
return
addFao:
WinActivate, %applicationName%,
GuiControl, Focus, Fao
Send, {CTRLDOWN}a{CTRLUP}{BACKSPACE}{CTRLDOWN}v{CTRLUP}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Find Project code
;ctrl alt and p triggers a code check
^!p::
Gui, Submit, noHide ;
Send, {CTRLDOWN}c{CTRLUP}
Run, C:\Program Files\Internet Explorer\iexplore.exe http://arq/tools/finance/my_oracle/project_lookup.asp
WinWait, Project Lookup - Windows Internet Explorer, Address Combo Contro
WinMaximize ,Project Lookup - Windows Internet Explorer, Address Combo Contro
IfWinNotActive, Project Lookup - Windows Internet Explorer, Address Combo Contro, WinActivate, Project Lookup - Windows Internet Explorer, Address Combo Contro
WinWaitActive, Project Lookup - Windows Internet Explorer, Address Combo Contro
MouseClick, left, 359, 196
Sleep, 100
Send, {CTRLDOWN}a{CTRLUP}{BACKSPACE}{CTRLDOWN}v{CTRLUP}{ENTER}
return
;;;; Via GUI ;;;;;;;;
CheckPcode:
Gui, Submit, noHide ;
Run, C:\Program Files\Internet Explorer\iexplore.exe http://arq/tools/finance/my_oracle/project_lookup.asp
WinWait, Project Lookup - Windows Internet Explorer, Address Combo Contro
WinMaximize,Project Lookup - Windows Internet Explorer
IfWinNotActive, Project Lookup - Windows Internet Explorer, Address Combo Contro, WinActivate, Project Lookup - Windows Internet Explorer, Address Combo Contro
WinWaitActive, Project Lookup - Windows Internet Explorer, Address Combo Contro
MouseClick, left, 359, 196
Sleep, 100
Send, {CTRLDOWN}a{CTRLUP}{BACKSPACE}%PrCode%{ENTER}
;msgBox %PrCode%
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; find site
^!s::
Send, {CTRLDOWN}c{CTRLUP}
Run, C:\Program Files\Internet Explorer\iexplore.exe http://keep.ngw.uk.com/Keep/Site/findSite.asp?
WinWait, KEEP - Windows Internet Explorer, Address Combo Contro
WinMaximize,KEEP - Windows Internet Explorer
IfWinNotActive, KEEP - Windows Internet Explorer, Address Combo Contro, WinActivate, KEEP - Windows Internet Explorer, Address Combo Contro
WinWaitActive, KEEP - Windows Internet Explorer, Address Combo Contro
MouseClick, left, 443, 160
Sleep, 100
Send, {CTRLDOWN}v{CTRLUP}{CTRLUP}{ENTER}
return
;;;; via GUI ;;;;;;;;;;;;
FindScode:
Gui, Submit, noHide ;
Run, C:\Program Files\Internet Explorer\iexplore.exe http://keep.ngw.uk.com/Keep/Site/findSite.asp?
WinWait, KEEP - Windows Internet Explorer, Address Combo Contro
WinMaximize,KEEP - Windows Internet Explorer
IfWinNotActive, KEEP - Windows Internet Explorer, Address Combo Contro, WinActivate, KEEP - Windows Internet Explorer, Address Combo Contro
WinWaitActive, KEEP - Windows Internet Explorer, Address Combo Contro
MouseClick, left, 443, 160
Sleep, 100
Send, %sCode%{ENTER}
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ShortcutsHint:
msgBox,
(LTrim
Highlight text, then:
CTRL+/ brings up the right click menu!
Ctrl+Alt+S searches for site ID
Ctrl+Alt+P searches for project code
Have fun! =)
)
return
AboutHint:
msgBox,
(LTrim
Sun Lotion
Created by Todor Imreorov - 2016 (c)
Data Entry helper application
Created fr use with SolarVista, KEEP,
Unlicensed
)
return
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
findSite:
Run, C:\Program Files\Internet Explorer\iexplore.exe http://keep.ngw.uk.com/Keep/Site/findSite.asp?
WinWait, KEEP - Windows Internet Explorer, Address Combo Contro
WinMaximize,KEEP - Windows Internet Explorer
IfWinNotActive, KEEP - Windows Internet Explorer, Address Combo Contro, WinActivate, KEEP - Windows Internet Explorer, Address Combo Contro
WinWaitActive, KEEP - Windows Internet Explorer, Address Combo Contro
MouseClick, left, 443, 160
Sleep, 100
Send, {CTRLDOWN}v{CTRLUP}{CTRLUP}{ENTER}
;;paste in sun lotion
WinActivate, %applicationName%,
GuiControl, Focus, sCode
Send, {CTRLDOWN}v{CTRLUP}
return
;;;;;;;;;;;;;;;;;;;;;;;;
findProject:
Gui, Submit, noHide ;
Send, {CTRLDOWN}c{CTRLUP}
Run, C:\Program Files\Internet Explorer\iexplore.exe http://arq/tools/finance/my_oracle/project_lookup.asp
WinWait, Project Lookup - Windows Internet Explorer, Address Combo Contro
WinMaximize ,Project Lookup - Windows Internet Explorer, Address Combo Contro
IfWinNotActive, Project Lookup - Windows Internet Explorer, Address Combo Contro, WinActivate, Project Lookup - Windows Internet Explorer, Address Combo Contro
WinWaitActive, Project Lookup - Windows Internet Explorer, Address Combo Contro
MouseClick, left, 359, 196
Sleep, 100
Send, {CTRLDOWN}a{CTRLUP}{BACKSPACE}{CTRLDOWN}v{CTRLUP}{ENTER}
;;paste in sun lotion
WinWaitActive, %applicationName%,
GuiControl, Focus, PrCode
Send, {CTRLDOWN}v{CTRLUP}
return
;;;;;;;;;;;;;;;;;;;
null:
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment