Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv
- #SingleInstance,Force
- ; #Warn
- ; ===============================================
- ; ===============================================
- ; Vars
- ; ===============================================
- ; ===============================================
- OnMessage(0x201,"Check_Control")
- OnMessage(0x200, "WM_MOUSEMOVE")
- temp_Last_Name_Edit:="Last Name*",
- temp_First_Name_Edit:="First Name*",
- temp_Disturbance_App:="App*"
- temp_Disturbance_Title:="Title*"
- temp_Disturbance_Affected_App:="Affected App or Service*"
- temp_Disturbance_Affected_Business:="Affected Business*"
- temp_Disturbance_Affected_Market:="Affected Markets*"
- temp_Disturbance_Next_Info:="Next Information*"
- Unchanged_Last:=1,
- Unchanged_First:=1
- Unchanged_App:=1
- Unchanged_Title:=1
- Unchanged_Affected_App:=1
- Unchanged_Affected_Business:=1
- Unchanged_Affected_Market:=1
- Unchanged_Next_Info:=1
- Font_Options:="cRed Q5",
- Font_Type:="Verdana",
- SetFontOptions:="Q5",
- SetFontType:="Verdana"
- Last_Name_Edit_TT := "Enter your lastname."
- First_Name_Edit_TT := "Enter your firstname."
- Inline_TT := "Opens INLINE Disturbance channel."
- Disturbance_App_TT := "Fill in the name of the application or service."
- Disturbance_Title_TT := "Fill in the title of the disturbance (no timestamp)."
- Disturbance_Content_TT := "Fill in the description of the disturbance."
- Disturbance_Affected_App_TT := "What is the affected application or service?"
- Disturbance_Affected_Business_TT := "What is the affected business?"
- Disturbance_Affected_Market_TT := "What is the affected market?"
- Disturbance_Next_Info_TT := "When will be the next update?"
- Create_New_Disturbance_TT := "Opens INLINE disturbance creation form."
- Send_SMS_TT := "Opens an email with the above information already filled in."
- Reset_TT := "Reload the tool."
- ; Icon:="C:\Windows\System32\wmploc.DLL, 12"
- Icon_App:= % A_ScriptDir . "\images\wmploc_474.ico"
- ; ===============================================
- ; ===============================================
- ; Gui
- ; ===============================================
- ; ===============================================
- ; GUI settings
- ; ===============================================
- SysGet, marea, Monitor
- wfactor= 6 ;Customize to adjust the horizontal position based on OS edition and style
- Width= 320
- Height= 580
- Xpos := (marearight-Width-wfactor)
- Ypos := 0
- ; Disturbance_Message := "`n`n`nADDITIONAL INFORMATION:`nAffected services/applications:`nAffected business process:`nAffected markets:`nNext information:`n`nFor more information contact your local IT Service Desk."
- WinID := "Create message - Scania InLine - Internet Explorer ahk_class IEFrame ahk_exe IEXPLORE.EXE"
- ; GUI generation
- ; ===============================================
- Gui,1: Margin,, 10
- Gui,1: Default
- Gui,1: +Caption +Border -AlwaysOnTop
- Gui,1: Color, cFFFFFF
- Gui,1: Font, Normal, Verdana
- Gui,1: Add, Tab3,, Main|Keyboard shortcuts
- Gui,1: Tab, Keyboard shortcuts,
- Gui,1: Add, Text, xm+10 ym+30 w260,Here's a list of the keyboard shortcuts and keyphrases that I use to ease my busy IMC life.`nExemple of use: writing sms_sig will trigger the action to type in your personal information when writing a SMS email.
- Gui,1: Add, Text, Section, ALT + A:
- Gui,1: Add, Text, ys w260, Insert timestamp and carrier return.
- Gui,1: Add, Text, Section xm+10 y+10, ===:
- Gui,1: Add, Text, ys w260, Insert a line full of = signs (50).
- Gui,1: Add, Text, Section xm+10 y+10, sms_sig:
- Gui,1: Add, Text, ys w260, Writes your personal information when writing a SMS email.
- Gui,1: Tab, Main,
- Gui,1: Add, GroupBox, Section xm+10 ym+30 h45 w280, Who are you?
- Gui,1: Font,% Font_Options ,% Font_Type
- Gui,1: Add, Edit, Section xs+10 ys+15 w125 r1 vLast_Name_Edit gSubmit_All, % temp_Last_Name_Edit
- Gui,1: Add, Edit, ys w125 r1 vFirst_Name_Edit gSubmit_All, % temp_First_Name_Edit
- Gui,1: Font,
- Gui,1: Font, Normal ,Verdana
- Gui,1: Add, GroupBox, xm+10 y+25 Section h450 w280, Inline disturbances
- Gui,1: Add, Button, xs+10 ys+20 Uppercase h25 vInline gOpen_Inline, &Check INLINE
- Gui,1: Font,% Font_Options ,% Font_Type
- Gui,1: Add, Edit, Section xm+20 y+20 w125 r1 Uppercase vDisturbance_App gSubmit_All, % temp_Disturbance_App
- Gui,1: Add, Edit, ys w125 r1 vDisturbance_Title gSubmit_All, % temp_Disturbance_Title
- Gui,1: Add, Edit, xm+20 y+20 w260 r5 vDisturbance_Content gSubmit_All, Content*
- Gui,1: Add, Edit, xm+20 y+20 w260 r1 vDisturbance_Affected_App gSubmit_All, % temp_Disturbance_Affected_App
- Gui,1: Add, Edit, xm+20 y+20 w260 r1 vDisturbance_Affected_Business gSubmit_All, % temp_Disturbance_Affected_Business
- Gui,1: Add, Edit, xm+20 y+20 w260 r1 vDisturbance_Affected_Market gSubmit_All, % temp_Disturbance_Affected_Market
- Gui,1: Add, Edit, xm+20 y+20 w260 r1 vDisturbance_Next_Info gSubmit_All, % temp_Disturbance_Next_Info
- Gui,1: Font,
- Gui,1: Font, Normal ,Verdana
- Gui,1: Add, Button, Section xm+20 y+10 h25 gCreate_New_Disturbance, Create a New disturbance
- Gui,1: Add, Button, ys h25 gSend_SMS, Send SMS
- Gui,1: Add, Button, Section xm+20 y+30 h25 vReset gButt_Reset, &Reset
- Gui,1: Add, Button, ys hp gGuiClose, Exit
- Gui,1: Show, w%Width% h%Height% x%Xpos% y%Ypos%, IMC Survival kit
- Menu, tray, Icon , %Icon_App%, 1, 1
- Return
- ; ===============================================
- ; ===============================================
- ;Labels/actions
- ; ===============================================
- ; ===============================================
- ; Empty Gui
- ; ===============================================
- Butt_Reset:
- Reload
- Return
- ; Close button action
- ; ===============================================
- GuiClose:
- ExitApp
- Return
- ; Send SMS button action
- ; ===============================================
- Submit_All:
- Gui,1: Submit, NoHide
- Return
- Open_Inline:
- Gui,1: Submit, NoHide
- ; Run iexplore.exe, https://inline.scania.com/scripts/cgiip.exe/WService=inline/cm/pub/showdoc.p?docid=577&showchannelid=4019
- wb := ComObjCreate("InternetExplorer.Application")
- wb.Visible := true
- wb.Navigate("https://inline.scania.com/scripts/cgiip.exe/WService=inline/cm/pub/showdoc.p?docid=577&showchannelid=4019")
- Return
- Create_New_Disturbance:
- Gui,1: Submit, NoHide
- ; MsgBox, %Mon1Left% & %Mon1Left% and %Xmouse% - %Ymouse%
- ; SysGet, Mon2, Monitor, 2
- ; Xmouse := %Mon2Left%//2
- ; Ymouse := %Mon2Bottom%//2
- ; MsgBox, Left: %Mon2Left% -- Top: %Mon2Top% -- Right: %Mon2Right% -- Bottom %Mon2Bottom% -- %Xmouse% %Ymouse%.
- ; MouseMove, Xmouse, Ymouse, 0
- Gui,2: Add, Text, cRed Bold s48, Locking your mouse while sending data to webpage.
- Gui,2: Show, x0 y0 Autosize, Please wait ...
- BlockInput MouseMove
- If !WinExist(WinID)
- {
- wb := ComObjCreate("InternetExplorer.Application")
- wb.Visible := true
- wb.Navigate("https://inline.scania.com/scripts/cgiip.exe/WService=inline/cm/pub/showdoc.p?docid=598&channeltypeId=3&channelid=4019")
- }
- Else
- {
- WinActivate
- }
- Gosub Insert_New_Disturbance
- Return
- Insert_New_Disturbance:
- ; Sleep 8000
- Countdown()
- FormatTime, time, A_now, dd/MM/yyyy HH:mm tt
- SendInput,
- (
- %time% CEST. NEW DISTURBANCE:{space}%Disturbance_App%: %Disturbance_Title%
- {tab}{i}{tab}%Disturbance_Content%
- )
- Tooltip,
- fn_Tab_Loop(11)
- SendInput, Scania IT IM
- fn_Tab_Loop(1)
- SendInput, im.scania_it@scania.com
- BlockInput MouseMoveOff
- Gui,2: Destroy
- Return
- Send_SMS:
- Gui,1: Submit, NoHide
- Email_Body := % time . " CEST. NEW DISTURBANCE: " . Disturbance_App . ": " . Disturbance_Title . ". " . Disturbance_Content . " \\" . First_Name_Edit . " " . Last_Name_Edit . ", Scania Incident Management."
- Run, mailto:dl0210@scania.com?body=%Email_Body%
- Sleep 1000
- MsgBox, 0x30, Warning, Don't forget to change the FROM field / sender email address.
- Return
- ; ===============================================
- ; ===============================================
- ;Functions
- ; ===============================================
- ; ===============================================
- ; Countdown
- ; ===============================================
- Countdown()
- {
- Loop 8
- {
- ToolTip, % "Sending data in: " . 9 - A_Index ; if you just use A_Index it starts at 1 2 3 etc
- Sleep 1000
- }
- Tooltip, 0
- }
- ; Tab nav
- ; ===============================================
- fn_Tab_Loop(x)
- {
- Counter := 0
- Loop
- {
- Counter++
- SendInput, {Tab}
- Sleep, 200
- if (Counter = x)
- Break
- }
- Return
- }
- WM_MOUSEMOVE()
- {
- static CurrControl, PrevControl, _TT ; _TT is kept blank for use by the ToolTip command below.
- CurrControl := A_GuiControl
- If (CurrControl <> PrevControl and not InStr(CurrControl, " "))
- {
- ToolTip ; Turn off any previous tooltip.
- SetTimer, DisplayToolTip, 500
- PrevControl := CurrControl
- }
- return
- DisplayToolTip:
- SetTimer, DisplayToolTip, Off
- ToolTip % %CurrControl%_TT ; The leading percent sign tell it to use an expression.
- SetTimer, RemoveToolTip, 3000
- return
- RemoveToolTip:
- SetTimer, RemoveToolTip, Off
- ToolTip
- return
- }
- Check_Control(){
- global
- if(A_GuiControl="Last_Name_Edit"&&Unchanged_Last=1)
- PromptFunction("Last_Name_Edit",Unchanged_Last,SetFontOptions,SetFontType,"1")
- else if(Unchanged_Last=0&&Last_Name_Edit=null)
- PromptFunction("Last_Name_Edit",Unchanged_Last,Font_Options,Font_Type,"1",temp_Last_Name_Edit)
- if(A_GuiControl="First_Name_Edit"&&Unchanged_First=1)
- PromptFunction("First_Name_Edit",Unchanged_First,SetFontOptions,SetFontType,"1")
- else if(Unchanged_First=0&&First_Name_Edit=null)
- PromptFunction("First_Name_Edit",Unchanged_First,Font_Options,Font_Type,"1",temp_First_Name_Edit)
- if(A_GuiControl="Disturbance_App"&&Unchanged_App=1)
- PromptFunction("Disturbance_App",Unchanged_App,SetFontOptions,SetFontType,"1")
- else if(Unchanged_App=0&&Disturbance_App=null)
- PromptFunction("Disturbance_App",Unchanged_App,Font_Options,Font_Type,"1",temp_Disturbance_App)
- if(A_GuiControl="Disturbance_Title"&&Unchanged_Title=1)
- PromptFunction("Disturbance_Title",Unchanged_Title,SetFontOptions,SetFontType,"1")
- else if(Unchanged_App=0&&Disturbance_Title=null)
- PromptFunction("Disturbance_Title",Unchanged_Title,Font_Options,Font_Type,"1",temp_Disturbance_Title)
- if(A_GuiControl="Disturbance_Affected_App"&&Unchanged_Affected_App=1)
- PromptFunction("Disturbance_Affected_App",Unchanged_Affected_App,SetFontOptions,SetFontType,"1")
- else if(Unchanged_Affected_App=0&&Disturbance_Affected_App=null)
- PromptFunction("Disturbance_Affected_App",Unchanged_Affected_App,Font_Options,Font_Type,"1",temp_Disturbance_Affected_Business)
- if(A_GuiControl="Disturbance_Affected_Business"&&Unchanged_Affected_Business=1)
- PromptFunction("Disturbance_Affected_Business",Unchanged_Affected_Business,SetFontOptions,SetFontType,"1")
- else if(Unchanged_Affected_Business=0&&Disturbance_Affected_Business=null)
- PromptFunction("Disturbance_Affected_Business",Unchanged_Affected_Business,Font_Options,Font_Type,"1",temp_Disturbance_Affected_Business)
- if(A_GuiControl="Disturbance_Affected_Market"&&Unchanged_Affected_Market=1)
- PromptFunction("Disturbance_Affected_Market",Unchanged_Affected_Market,SetFontOptions,SetFontType,"1")
- else if(Unchanged_Affected_Market=0&&Disturbance_Affected_Market=null)
- PromptFunction("Disturbance_Affected_Market",Unchanged_Affected_Market,Font_Options,Font_Type,"1",temp_Disturbance_Affected_Market)
- if(A_GuiControl="Disturbance_Next_Info"&&Unchanged_Next_Info=1)
- PromptFunction("Disturbance_Next_Info",Unchanged_Next_Info,SetFontOptions,SetFontType,"1")
- else if(Unchanged_Next_Info=0&&Disturbance_Next_Info=null)
- PromptFunction("Disturbance_Next_Info",Unchanged_Next_Info,Font_Options,Font_Type,"1",temp_Disturbance_Next_Info)
- }
- PromptFunction(ByRef TargetEdit,ByRef State,FOptions,FType,GuiName,TempText:="" ){
- State:=!State
- GuiControl,%GuiName%:,%TargetEdit%,% TempText
- Gui,%GuiName%:Font,
- Gui,%GuiName%:Font,% FOptions ,% FType
- GuiControl,%GuiName%:Font,%TargetEdit%
- }
- ; ===============================================
- ; ===============================================
- ;Hotkeys
- ; ===============================================
- ; ===============================================
- f11::listvars
- ::sms_sig::
- SendInput, // %First_Name_Edit% %Last_Name_Edit%, Incident Manager, Scania CV AB
- Return
- ::===::
- SendInput, ===============================================
- Return
- ::new_disturbance::
- FormatTime, time, A_now, dd/MM/yyyy HH:mm tt
- SendInput,
- (
- %time% CEST. NEW DISTURBANCE:{space}
- {tab}{tab}{enter}
- ADDITIONAL INFORMATION:{enter}
- Affected services/applications:{space}
- Affected business process:{space}
- Affected markets:{space}
- Next information:{space}{enter}
- For more information contact your local IT Service Desk.
- )
- Return
- !a::
- FormatTime, time, A_now, dd/MM/yyyy HH:mm tt
- sendInput, %time%{enter}
- return
- ~Tab::
- sleep,50
- ControlGetFocus,temp2,A,
- GuiControlGet,temp3,1:Name,%temp2%
- if(temp3="Last_Name_Edit"&&Unchanged_Last=1)
- PromptFunction("Last_Name_Edit",Unchanged_Last,SetFontOptions,SetFontType,"1")
- else if(Unchanged_Last=0&&Last_Name_Edit=null)
- PromptFunction("Last_Name_Edit",Unchanged_Last,Font_Options,Font_Type,"1",temp_Last_Name_Edit)
- if(temp3="First_Name_Edit"&&Unchanged_First=1)
- PromptFunction("First_Name_Edit",Unchanged_First,SetFontOptions,SetFontType,"1")
- else if(Unchanged_First=0&&First_Name_Edit=null)
- PromptFunction("First_Name_Edit",Unchanged_First,Font_Options,Font_Type,"1",temp_First_Name_Edit)
- if(temp3="Disturbance_App"&&Unchanged_App=1)
- PromptFunction("Disturbance_App",Unchanged_App,SetFontOptions,SetFontType,"1")
- else if(Unchanged_App=0&&Disturbance_App=null)
- PromptFunction("Disturbance_App",Unchanged_App,Font_Options,Font_Type,"1",temp_Disturbance_App)
- if(temp3="Disturbance_Title"&&Unchanged_Title=1)
- PromptFunction("Disturbance_Title",Unchanged_Title,SetFontOptions,SetFontType,"1")
- else if(Unchanged_Title=0&&Disturbance_Title=null)
- PromptFunction("Disturbance_Title",Unchanged_Title,Font_Options,Font_Type,"1",temp_Disturbance_Title)
- if(temp3="Disturbance_Affected_App"&&Unchanged_Affected_App=1)
- PromptFunction("Disturbance_Affected_App",Unchanged_Affected_App,SetFontOptions,SetFontType,"1")
- else if(Unchanged_Affected_App=0&&Disturbance_Affected_App=null)
- PromptFunction("Disturbance_Affected_App",Unchanged_Affected_App,Font_Options,Font_Type,"1",temp_Unchanged_Affected_App)
- if(temp3="Disturbance_Affected_Business"&&Unchanged_Affected_Business=1)
- PromptFunction("Disturbance_Affected_Business",Unchanged_Affected_Business,SetFontOptions,SetFontType,"1")
- else if(Unchanged_Affected_Business=0&&Disturbance_Affected_Business=null)
- PromptFunction("Disturbance_Affected_Business",Unchanged_Affected_Business,Font_Options,Font_Type,"1",temp_Unchanged_Affected_Business)
- if(temp3="Disturbance_Affected_Market"&&Unchanged_Affected_Market=1)
- PromptFunction("Disturbance_Affected_Market",Unchanged_Affected_Market,SetFontOptions,SetFontType,"1")
- else if(Unchanged_Affected_Market=0&&Disturbance_Affected_Market=null)
- PromptFunction("Disturbance_Affected_Market",Unchanged_Affected_Market,Font_Options,Font_Type,"1",temp_Unchanged_Affected_Market)
- if(temp3="Disturbance_Next_Info"&&Unchanged_Next_Info=1)
- PromptFunction("Disturbance_Next_Info",Unchanged_Next_Info,SetFontOptions,SetFontType,"1")
- else if(Unchanged_Next_Info=0&&Disturbance_Next_Info=null)
- PromptFunction("Disturbance_Next_Info",Unchanged_Next_Info,Font_Options,Font_Type,"1",temp_Unchanged_Next_Info)
- return
- ::Soder::
- ::soder::
- SendInput, Södertälje
- Return
- ::tack::
- SendInput, Tack för din hjälp
- Return
- ::ops ehd::
- SendInput, OPS EHD Service Desk Scania Angers{Tab}{Enter}
- Return
- ::de_rien::
- SendInput, Varsågod
- Return
Add Comment
Please, Sign In to add comment