Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

My menu is keeps growing?



  • Please log in to reply
2 replies to this topic
amgreenwalt
  • Members
  • 12 posts
  • Last active: Jan 05 2016 08:30 PM
  • Joined: 07 Apr 2014

I have recently added a menu to my script and everything is working fine except the more I use the script the more my menu continues to grow!  With each use a blank line gets added to the bottom of my menu? Not sure how to paste/attach a screenshot to show you.

;!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Current Time Send!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	^T::
FormatTime, Rmdytime, hh{:}mm{:}ss, ShortDate
formattime, rmdytime2, , Time
send %Rmdytime% %rmdytime2% Arizona`n
	return
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!End Current Time Send!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Remedy Ticket From PBI Email!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$F11::

;clear clipboard
clipboard =

SetTitleMatchMode 2
 IfWinExist Calence Management Services -
 
    WinActivate
	
    ; open email, copy all contents, close email
	
    Sleep, 500
    Send ^r
    WinActivate RE:
    WinWait RE:
    Send ^a^c
    Sleep, 500
    WinClose RE:

clipwait, 2
 if ErrorLevel {
    msgbox, Failed to copy to clipbaord
    return
}

    ; #### extract data from clipboard into parsed data ####
    RegExMatch(clipboard, "Problem Investigation:\s(.*)", descr)
    RegExMatch(clipboard, "Company:\s\s\s\s(.*)", compy)
    RegExMatch(clipboard, "Region:\s\s\s\s\s\s\s(.*)", regin)
    RegExMatch(clipboard, "Site Group:\s\s(.*)", stgrp)
    RegExMatch(clipboard, "Site:\s\s\s\s\s\s\s\s\s\s\s\s\s(.*)", sitid)
    RegExMatch(clipboard, "Device:\s\s\s\s\s\s\s\s(.*)", dvcnm)
    RegExMatch(clipboard, "Description:\s(.*)", actkn)

Menu, Issues, Add, Select an issue from the Menu below, MenuHandler
Menu, Issues, Add,
Menu, Issues, Add,
Menu, Issues, Add, Reload, MenuHandler
Menu, Issues, Add, Vendor Router, MenuHandler
Menu, Issues, Add, Bandwidth, MenuHandler
Menu, Issues, Add, 3 Bounces, MenuHandler
Menu, Issues, Add, 4 Bounces, MenuHandler
Menu, Issues, Add, 5 Bounces, MenuHandler
Menu, Issues, Add, 3 WAN Errors, MenuHandler
Menu, Issues, Add, 4 WAN Errors, MenuHandler
Menu, Issues, Add, 5 WAN Errors, MenuHandler
Menu, Issues, Show
return

MenuHandler:
prblm = %A_ThisMenuItem%


if (prblm = "Reload") {
	tier2 = Reload
	tier3 = Other
} else if (prblm = "Bandwidth") {
	tier2 = Live Health
	tier3 = Bandwidth High
} else if (prblm = "Vendor Router") {
	tier2 = Other
	tier3 = Other
} else if (prblm = "3 Bounces") {
	tier2 = WAN
	tier3 = Intermittent Connectivity-WAN
} else if (prblm = "4 Bounces") {
	tier2 = WAN
	tier3 = Intermittent Connectivity-WAN
} else if (prblm = "5 Bounces") {
	tier2 = WAN
	tier3 = Intermittent Connectivity-WAN
} else if (prblm = "3 WAN Errors") {
	tier2 = WAN
	tier3 = Circuit Errors
} else if (prblm = "4 WAN Errors") {
	tier2 = WAN
	tier3 = Circuit Errors
} else if (prblm = "5 WAN Errors") {
	tier2 = WAN
	tier3 = Circuit Errors
}
if (prblm = "Reload") {
	subpat = PBI received the following email and investigated this issue.  PBI confirmed reloads due to power do not qualify as a chronic issue.  PBI recommends the client to verify all power & CPE including their UPS battery status.  No chronic ticket necessary.
} else if (prblm = "Bandwidth") {
	subpat = PBI received the following email and confirmed Bandwidth Utilization does not qualify as a chronic issue.
} else if (prblm = "Vendor Router") {
	subpat = PBI received the following email and investigated this issue.  PBI verified this is a Notify Only device with no managed circuits.  No chronic ticket is needed for Notify Only devices.
} else if (prblm = "3 Bounces") {
	subpat = PBI received the following email and investigated this issue.  PBI confirmed 3 circuit bounces in the last 30 days is not excessive and no chronic ticket is needed at this time.  PBI will continue to track this issue and open a ticket if necessary.
} else if (prblm = "4 Bounces") {
	subpat = PBI received the following email and investigated this issue.  PBI confirmed 4 circuit bounces in the last 30 days is not excessive and no chronic ticket is needed at this time.  PBI will continue to track this issue and open a ticket if necessary.
} else if (prblm = "5 Bounces") {
	subpat = PBI received the following email and investigated this issue.  PBI confirmed 5 circuit bounces in the last 30 days is not excessive and no chronic ticket is needed at this time.  PBI will continue to track this issue and open a ticket if necessary.
} else if (prblm = "3 WAN Errors") {
	subpat = PBI received the following email and investigated this issue.  PBI confirmed 3 tickets for WAN Errors in the last 30 days is not excessive and no chronic ticket is needed at this time.  PBI will continue to track this issue and open a ticket if necessary.
} else if (prblm = "4 WAN Errors") {
	subpat = PBI received the following email and investigated this issue.  PBI confirmed 4 tickets for WAN Errors in the last 30 days is not excessive and no chronic ticket is needed at this time.  PBI will continue to track this issue and open a ticket if necessary.
} else if (prblm = "5 WAN Errors") {
	subpat = PBI received the following email and investigated this issue.  PBI confirmed 5 tickets for WAN Errors in the last 30 days is not excessive and no chronic ticket is needed at this time.  PBI will continue to track this issue and open a ticket if necessary.
}
	
Sleep 750

 if (compy1 = "Avnet") {
    vndrtkt = PM0000000
  } else {
    vndrtkt = NON CRITICAL
  }

SetTitleMatchMode 2
  IfWinExist Remedy User
  {
    IfWinExist Remedy User - [PBM:Problem Investigation (New)]
    {
	WinActivate
    }
    IfWinExist Remedy User - [PBM:Problem Investigation (New)]
    {
	WinActivate
    }
    else
    {
	MsgBox, Something is wrong,`n Please open a new ticket first.
	return
    }
  }
	
	; ################### Requester Information ####################
	Send %descr1%
	Send {Tab}
	Sleep, 500
	Send cc
	Send {Tab 2}
	Sleep, 500
	Send {Alt Down}
	Send {Down 5}
	Send {Alt Up}
	Sleep, 500
	Send {Enter}
	Send {Tab}
	Send {Alt Down}
	Send {Down 5}
	Send {Alt Up}
	Sleep, 500
	Send {Enter}
	Send {Tab 14}
	Sleep, 500
	Send %compy1%
	Send {Tab}
	Sleep, 500
	Send %regin1%
	Send {Tab}
	Sleep, 500
	Send %stgrp1%
	Send {Tab}
	Sleep, 500
	Send %sitid1%
	Send {Tab 26}
	Send {Right}
	Sleep, 700
	; ################### Classification ####################
        Send {Tab 8}
	Sleep, 500
        Send Data
	Send {Tab}
        Send %tier2%
	Sleep, 500
	Send {Tab}
        Send %tier3%
	Sleep, 500
	Send {Tab 10}
	Sleep, 500
	Send %dvcnm1%
	Send {Tab 23}
	Send {Right}
	Sleep, 700
	; ################### Assignment ####################
	Send {Tab 7}
	Send {Enter}
	Sleep, 500
	Send {Tab 9}
	Send {Enter}
	Sleep, 500
	Send {Tab 28}
	Send {Right}
	Send {Tab 8}
	Send %vndrtkt%
	Send {Tab 24}
	Sleep, 500
	Send {Right 2}
	Sleep, 700
	; ################### Work Log ####################
	Send {Tab 3}
	Send {Enter}
	Sleep, 500
	Send {Tab 3}
	Send %dvcnm1%
	Send {Tab}
	Send u
	Sleep, 500
	Send {Tab}
	Send %subpat%
	Send {Enter 2}
	Send %actkn1%
	Send {Tab}
	Sleep, 500
	Send Close this ticket.
	Send {Tab 4}
	Sleep, 500
	Send {Enter}
	return
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!End Remedy Ticket From PBI Email!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Esc::ExitApp  ;Escape key will exit


GEV
  • Members
  • 1364 posts
  • Last active:
  • Joined: 23 Oct 2013

Try this:

 

...

    RegExMatch(clipboard, "Description:\s(.*)", actkn)
Menu, Issues, Add
Menu, Issues, deleteAll

Menu, Issues, Add, Select an issue from the Menu below, MenuHandler
Menu, Issues, Add,
Menu, Issues, Add, Reload, MenuHandler
...
 



Oldman
  • Members
  • 2475 posts
  • Last active: Feb 18 2015 04:57 PM
  • Joined: 01 Dec 2013
✓  Best Answer

Or put the creation of the menu in the auto-execute section of the script.

Leave the "Menu, Issues, Show" at the end of the hotkey $F11.

Menu, Issues, Add, Select an issue from the Menu below, MenuHandler
Menu, Issues, Add,
Menu, Issues, Add,
Menu, Issues, Add, Reload, MenuHandler
Menu, Issues, Add, Vendor Router, MenuHandler
Menu, Issues, Add, Bandwidth, MenuHandler
Menu, Issues, Add, 3 Bounces, MenuHandler
Menu, Issues, Add, 4 Bounces, MenuHandler
Menu, Issues, Add, 5 Bounces, MenuHandler
Menu, Issues, Add, 3 WAN Errors, MenuHandler
Menu, Issues, Add, 4 WAN Errors, MenuHandler
Menu, Issues, Add, 5 WAN Errors, MenuHandler
return

    RegExMatch(clipboard, "Device:\s\s\s\s\s\s\s\s(.*)", dvcnm)
    RegExMatch(clipboard, "Description:\s(.*)", actkn)

Menu, Issues, Show
return


Si ton labeur est dur et que tes résultats sont minces, souviens toi du grand chêne qui avant n'était qu'un gland....comme toi ! (anonyme) ;)

L'art de lire, c'est l'art de penser avec un peu d'aide. (É. Faguet)

Windows 3.1. Collector's Edition.     (www.avaaz.org)