Sign in to follow this  
Followers 0
jazs

Premature start

4 posts in this topic

I have created a hugh menu that uses tabs. When I open the menu, it automatically starts the first script.. Is there something i'm missing r would any of you have an idea that would make the scripts not start until I have executed a button that is attached to the scripts via a menu??

Share this post


Link to post
Share on other sites



I have created a hugh menu that uses tabs. When I open the menu, it automatically starts the first script.. Is there something i'm missing r would any of you have an idea that would make the scripts not start until I have executed a button that is attached to the scripts via a menu??

Can you post the code you have?


Other People's Stuff:Andy Flesner's AutoIt v3: Your Quick Guide[topic="34302"]Locodarwin's ExcelCom_UDF[/topic][topic="61090"]MrCreatorR's Opera Library[/topic]

Share this post


Link to post
Share on other sites

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()

Local $winpoint, $pctransfer, $seqnumber, $rpttype, $atmedit, $atmacquire, $acquirer, $atmissuer, $issuer, $atmsettle, $winpoint

Local $msg, $tab, $tab0, $tab0OK, $tab0input, $batch, $lockbox, $lockboxsave, $scifcp, $status, $ficsmshstry, $history, $gl, $tlrpmt, $filemove, $image, $psr, $itemCount, $counter

Local $lockpsr, $lockdate, $loan, $mortgagedate, $gl, $glcreate, $tab1, $tab1combo, $tab1OK, $intResponse, $oldfile, $inq

Local $tab2, $tab2OK, $msg

Local $tab3

Local $yr, $mn, $yr

GUICreate("Fics Menu", 350, 350); will create a dialog box that when displayed is centered

GUISetBkColor(0x00E0FFFF)

GUISetFont(9, 300)

$tab = GUICtrlCreateTab(10, 10, 300, 300)

$tab0 = GUICtrlCreateTabItem("Mornings")

$itemCount=GUICtrlCreateButton("Batch Clear", 20, 50, 110, 23)

$lockbox=GUICtrlCreateButton("Winpoint", 20, 50, 110, 23)

$lockboxsave=GUICtrlCreateButton("PC Transfer", 20, 75, 110, 23)

$scifcp=GUICtrlCreateButton("Atm Edit", 20, 100, 110, 23)

$status=GUICtrlCreateButton("Atm Acquirer", 20, 125, 110, 23)

$ficsmshstry=GUICtrlCreateButton("Atm Issuer", 20, 150, 110, 23)

$history=GUICtrlCreateButton("Atm Settlement", 20, 175, 110, 23)

$tab1 = GUICtrlCreateTabItem("Fics")

$itemCount=GUICtrlCreateButton("Batch Clear", 20, 50, 110, 23)

$tlrpmt=GUICtrlCreateButton("Teller Payment", 20, 75, 110, 23)

$lockbox=GUICtrlCreateButton("Lockbox Rename", 20, 100, 110, 23)

$lockboxsave=GUICtrlCreateButton("Lockbox Save", 20, 125, 110, 23)

$scifcp=GUICtrlCreateButton("Status Inquiry", 20, 150, 110, 23)

$status=GUICtrlCreateButton("Status Rename", 20, 175, 110, 23)

$ficsmshstry=GUICtrlCreateButton("History", 20, 200, 110, 23)

$history=GUICtrlCreateButton("History Rename", 20, 225, 110, 23)

$glcreate=GUICtrlCreateButton("GL", 20, 250, 110, 23)

$gl=GUICtrlCreateButton("GL Rename", 20, 275, 110, 23)

$tab2 = GUICtrlCreateTabItem("Move and Rename")

$filemove=GUICtrlCreateButton("File Copy", 20, 50, 110, 23)

$image=GUICtrlCreateButton("Image rename", 20, 75, 110, 23)

$psr=GUICtrlCreateButton("Delete .psr", 20, 100, 110, 23)

$lockpsr=GUICtrlCreateButton(".Psr Date", 20, 125, 110, 23)

$lockdate=GUICtrlCreateButton("Lockbox Date", 20, 150, 110, 23)

$loan=GUICtrlCreateButton("Loan Date", 20, 175, 110, 23)

$mortgagedate=GUICtrlCreateButton("Mortgage Date", 20, 200, 110, 23)

$tab3 = GUICtrlCreateTabItem("Imaging")

$lockbox=GUICtrlCreateButton("Lockbox Rename", 20, 50, 110, 23)

$lockboxsave=GUICtrlCreateButton("Lockbox Save", 20, 75, 110, 23)

$scifcp=GUICtrlCreateButton("Status Inquiry", 20, 100, 110, 23)

$status=GUICtrlCreateButton("Status Rename", 20, 125, 110, 23)

$ficsmshstry=GUICtrlCreateButton("History", 20, 150, 110, 23)

$history=GUICtrlCreateButton("History Rename", 20, 175, 110, 23)

GUICtrlCreateTabItem(""); end tabitem definition

GUISetState()

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

If $msg = $tab Then

; display the clicked tab

WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($tab))

EndIf

$itemCount = RegRead("HKEY_CURRENT_USER\Software\Symitar\SFW\2.0\Batch Control\Recent", "Item Count")

if $itemCount = 'a' Then $itemCount = 10

$counter = $itemCount - 1

While $counter >= 0

RegDelete("HKEY_CURRENT_USER\Software\Symitar\SFW\2.0\Batch Control\Recent", "Item " & String($counter))

$counter = $counter - 1

WEnd

RegDelete("HKEY_CURRENT_USER\Software\Symitar\SFW\2.0\Batch Control\Recent", "Item Count")

;MsgBox(64, "Symitar Batch List", "Batch List Purged!")

Select

;###############################

;###############################

Case $msg = $winpoint ;######### This is where the program starts on its own

Opt("WinTitleMatchMode", 1) ;######### If I were to delete from here to the area marked end and run it,

WinActivate("Sym 000 - Episys - Batch Control") ;######### it would work fine

;sleep(1000)

send("!")

send("N")

send("I")

send("B")

send("!J")

sleep(1000)

send("WINPOINT.SCRIPT")

Sleep(1000)

send("{ENTER}")

Sleep(1000)

send("{ENTER}")

Sleep(1000)

send("{ENTER}")

Sleep(1000)

send("{ENTER}")

sleep(1000)

send("{ENTER}")

;queue priority

;sleep(1000)

send("{ENTER}")

send("{ENTER}")

;###############################################################################

;############################### Pc Transfer for Winpoint ######################

;-------------------------------------------------------------------------------

; Script Function:

; Automate the transfering of the winpoint files done on the morning ops schedule. This script is set to run from the users desktop,

; not the winpoint box.

;-------------------------------------------------------------------------------

Case $msg = $pctransfer

$seqnumber=inputbox("FTP Transfer","Seq #:")

$rpttype=inputbox("Report","Report type:")

; $pass=inputbox("Password" ,"Password:","","*")

Opt("WinTitleMatchMode", 1)

WinActivate("Sym 000 - Episys")

ControlClick ("Sym 000 - Episys", "", "ToolbarWindow322" ,"left" ,1 ,32,9)

Sleep(1000)

;ControlClick ("Sym 000 - Episys - Batch Control", "", "ToolbarWindow322" ,"left" ,1 ,148,9)

ControlClick ("Sym 000 - Episys", "", "ToolbarWindow322" ,"left" ,1 ,148,9)

Sleep(1000)

ControlClick ("Sym 000 - Episys - PC Transfer", "", "ToolbarWindow325" ,"left" ,1 ,11,10)

Sleep(1000)

WinActivate("FTP to Other System")

Send("{TAB}")

Send ("{DOWN}")

Send("{TAB}")

Send($seqnumber)

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send("{SPACE}")

Send("{TAB}")

Send("{TAB}")

Send("{TAB}")

Send($rpttype)

Send("{TAB}")

Send("pc111")

Send("{TAB}")

Send("domain/username") ;##### domain/username

Send("{TAB}")

Send("password") ;##### password

;Send($pass)

Send("{TAB}")

Send ("{ENTER}")

;###############################################################################

;###############################################################################

;-------------------------------------------------------------------------------

;Script to run the atm edit

;-------------------------------------------------------------------------------

Case $msg = $atmedit

Opt("WinTitleMatchMode", 1)

WinActivate("Sym 000 - Episys - Batch Control")

;sleep(1000)

send("!")

send("N")

send("I")

send("B")

send("!J")

;sleep(1000)

send("PASSPORT.EDIT")

Sleep(1000)

send("{ENTER}")

sleep(1000)

send("{ENTER}")

sleep(1000)

send("{ENTER}")

sleep(1000)

send("{ENTER}")

;###############################################################################

;############################### ATM Acquire ###################################

;-------------------------------------------------------------------------------

;Script to run the ATM Acquire job file.

;-------------------------------------------------------------------------------

Case $msg = $atmacquire

$acquirer=inputbox("Atm Acquirer","Seq #:")

WinActivate("Sym 000 - Episys - Batch Control")

;dim $acquirer

sleep(2000)

send("!")

send("N")

send("I")

send("B")

send("!J")

sleep(1000)

send("ATM.ACQUIRER.MWA")

send("{ENTER}")

sleep(1000)

send("{ENTER}")

sleep(1000)

send("{ENTER}")

sleep(1000)

send($acquirer)

sleep(1000)

send("{ENTER}")

send("{ENTER}")

;###############################################################################

;############################### ATM Issure ###################################

;-------------------------------------------------------------------------------

;Script to run the ATM Issure job file.

;-------------------------------------------------------------------------------

Case $msg = $atmissuer

$issuer=inputbox("Atm Acquirer","Seq #:")

WinActivate("Sym 000 - Episys - Batch Control")

;dim $issuer

sleep(2000)

send("!")

send("N")

send("I")

send("B")

send("!J")

sleep(1000)

send("ATM.ISSUER.MWA")

send("{ENTER}")

sleep(1000)

send("{ENTER}")

sleep(1000)

send("{ENTER}")

sleep(1000)

send($issuer)

sleep(1000)

send("{ENTER}")

send("{ENTER}")

;###############################################################################

;############################### ATM Settlement ###############################

;-------------------------------------------------------------------------------

;Script to run the ATM Settlement job file. Only goes back one day.

;-------------------------------------------------------------------------------

Case $msg = $atmsettle

Opt("WinTitleMatchMode", 1)

WinActivate("Sym 000 - Episys - Batch Control")

;sleep(3000)

send("!")

send("N")

send("I")

send("B")

send("!J")

;sleep(1000)

send("PASSPORT.SETTLEMENT.MWA")

Sleep(1000)

send("{ENTER}")

Sleep(1000)

send("{ENTER}")

Sleep(1000)

send("{2}")

Sleep(2000)

send("{ENTER}")

sleep(1000)

send("{ENTER}")

sleep(1000)

send("{ENTER}")

sleep(1000)

send("{ENTER}")

;######## This is the end of the script that I am having problems with

;######## The latter script works just fine as long as the above script isn't here

;###############################

;###############################

; Select

Case $msg = $tlrpmt

sleep(1000)

WinActivate("Sym 000 - Episys")

sleep(2000)

send("!")

send("N")

send("I")

send("B")

send("!J")

sleep(1000)

send("FICS.TELLER.PYMT")

send("{ENTER}")

sleep(1000)

;Batch Options

send("{LEFT}")

send("{ENTER}")

;Notify upon completion

send("{ENTER}")

;queue priority

sleep(1000)

send("8")

send("{ENTER}")

sleep(1000)

;Start Date

send("{ENTER}")

sleep(1000)

;Start Time

send("{ENTER}")

sleep(1000)

;Batch Queue

send("{ENTER}")

;sleep(1000)

;O.K.

send("{ENTER}")

; sleep(1000)

; send("{ENTER}")

;################################### Lockbox Rename

Case $msg = $lockbox

$intResponse=MsgBox(65, "Rename Lockbox file", "Press OK to Rename the FICSTELLERPAYMENTS file!")

if $intResponse=2 then exit

$oldfile=inputbox("Old letter file","Enter FICSTELLERPAYMENTS:","FICSTELLERPAYMENTS","")

$lockbox=inputbox("Old letter file","Lockbox Name:","LOCKBOX" & @MON & @MDAY,"")

WinActivate("Sym 000 - Episys - Letter File Control - ")

Sleep(1000)

Send("!fr")

Sleep(1000)

WinActivate("Rename")

Send($oldfile)

Send("{TAB}")

Send($lockbox)

Send("{ENTER}")

MsgBox(64, "Rename Successful", "Rename FICSHISTORYDATA successful!")

;MsgBox(64, "Rename Successful", "Renamed LockBox!")

;####################################### Saving the Lockbox file to Fics

Case $msg = $lockboxsave

dim $mn

dim $yr

Opt("WinTitleMatchMode", 2)

WinActivate("Mortgage Servicer")

sleep(3000)

MouseClick("left", 106, 325, 1)

sleep(1000)

send("C")

send("{ENTER}")

sleep(1000)

MouseClick("left", 295, 143, 1)

sleep(1000)

send("symitar{SPACE}p")

sleep(1000)

send("{ENTER}")

sleep(1000)

WinActivate("Symitar Payment Processing Program - \\Remote")

Send("{TAB}")

send("B")

sleep(1000)

send("CustomizedModules")

send("{ENTER}")

sleep(1000)

send("LOCKBOX" & @MON & @MDAY)

sleep(1000)

send("{ENTER}")

sleep(1000)

Send("{TAB}")

Send("{TAB}")

send("O")

sleep(9000)

MouseClick("left", 166, 32, 1)

sleep(3000)

send("M:\DailyReports\Lockbox" & @MON & @MDAY & "")

Send("{TAB}")

send("h")

sleep(1000)

send("{ENTER}")

sleep(1000)

Send("{TAB}")

send("{ENTER}")

sleep(2000)

;#Exception switch

MouseClick("left", 123, 32, 1)

sleep(2000)

;#Save

MouseClick("left", 166, 32, 1)

sleep(1000)

send("M:\DailyReports\LockboxException" & @MON & @MDAY & "")

Send("{TAB}")

send("h")

sleep(1000)

send("{ENTER}")

sleep(1000)

Send("{TAB}")

send("{ENTER}")

sleep(1000)

;#exit

MouseClick("left", 272, 32, 1)

;####################################### Symitar customer interface file creation

Case $msg = $scifcp

dim $mn

dim $yr

Opt("WinTitleMatchMode", 2)

WinActivate("Mortgage Servicer")

sleep(2000)

MouseClick("left", 106, 325, 1)

sleep(1000)

send("C")

send("{ENTER}")

sleep(2000)

MouseClick("left", 295, 143, 1)

sleep(1000)

send("symitar{SPACE}c")

send("{ENTER}")

sleep(2000)

$yr = StringRight(@YEAR,2)

if stringlen(@MON)<2 then

$mn = "0"* @MON

else

$mn =@MON

$mn =$mn

endif

sleep(1000)

Send(@MON&@MDAY&$yr)

send("{TAB}")

send("{TAB}")

send("b")

send("M:\CustomizedModules\MSSP183.fil")

sleep(1000)

send("{TAB}")

send("{TAB}")

send("O")

sleep(1000)

send("{TAB}")

send("{TAB}")

send("O")

sleep(7000)

send("{TAB}")

send("c")

;################################### Status rename

Case $msg = $status

$intResponse=MsgBox(65, "Rename MSSP183.FIL file", "Press OK to Rename MSSP183.fil file!")

if $intResponse=2 then exit

$oldfile=inputbox("Old letter file","Enter MSSP183.fil","MSSP183.fil","")

$inq=inputbox("New letter file","Lockbox Name:","FICSINQDATA","")

WinActivate("Sym 000 - Episys - Letter File Control - ")

Sleep(1000)

Send("!fr")

Sleep(1000)

WinActivate("Rename")

Send($oldfile)

Send("{TAB}")

Send($inq)

Send("{ENTER}")

MsgBox(64, "Rename Successful", "Rename FICSINQDATA successful!")

;###################################### History on fics creation

Case $msg = $ficsmshstry

dim $mn

dim $yr

Opt("WinTitleMatchMode", 2)

WinActivate("Mortgage Servicer")

sleep(1000)

MouseClick("left", 106, 325, 1)

send("C")

send("{ENTER}")

sleep(1000)

MouseClick("left", 295, 143, 1)

send("symitar{SPACE}h")

send("{ENTER}")

$yr = StringRight(@YEAR,2)

if stringlen(@MON)<2 then

$mn = "0"* @MON

else

$mn =@MON

$mn =$mn

endif

sleep(1000)

Send(@MON&@MDAY&$yr)

send("{TAB}")

Send(@MON&@MDAY&$yr)

sleep(1000)

send("{TAB}") ;Added the tab and took out the Mouseclick function

sleep(1000)

send("M:\CustomizedModules\MSHISTORY")

send("{TAB}")

send("{TAB}")

send("s")

sleep(2000)

send("{TAB}")

send("{TAB}")

send("{TAB}")

sleep(1000)

send("O")

sleep(1000)

send("Y")

;################################### History rename for symitar

Case $msg = $history

$intResponse=MsgBox(65, "Rename History file", "Press OK to Rename MSHISTORY!")

if $intResponse=2 then exit

$oldfile=inputbox("Old letter file","Enter MSHISTORY","MSHISTORY","")

$history=inputbox("New letter file","Lockbox Name:","FICSHISTORYDATA","")

WinActivate("Sym 000 - Episys - Letter File Control - ")

Sleep(1000)

Send("!fr")

Sleep(1000)

WinActivate("Rename")

Send($oldfile)

Send("{TAB}")

Send($history)

Send("{ENTER}")

MsgBox(64, "Rename Successful", "Rename FICSHISTORYDATA successful!")

;################################### Craeting the GL transactions on symitar

case $msg = $glcreate

$intResponse=MsgBox(65, "Create GL MASP010", "OK ")

if $intResponse=2 then exit

$yr = StringRight(@YEAR,2)

if stringlen(@MON)<2 then

$mn = "0"* @MON

else

$mn =@MON

$mn =$mn

endif

WinActivate("Mortgage Accountant")

Sleep(2000)

send("C")

sleep(1000)

send("{TAB}")

sleep(1000)

Send("{DOWN}")

send("{ENTER}")

sleep(1000)

Send(@MON&@MDAY&$yr)

Sleep(1000)

Send("{TAB}")

Send("m")

Send("{TAB}")

Sleep(1000)

Send("{TAB}")

send("{ENTER}")

Sleep(1000)

send("M:\CustomizedModules\MASP010")

sleep(2000)

send("{TAB}")

Sleep(1000)

send("{TAB}")

sleep(1000)

send("{ENTER}")

sleep(1000)

;send("{TAB}")

;send("{ENTER}")

;################################### Renaming the GL Mas file for symitar

Case $msg = $gl

$intResponse=MsgBox(65, "Rename GL file", "Press OK to Rename the MASP010 file!")

if $intResponse=2 then exit

$oldfile=inputbox("Old letter file","Enter GL Name","MASP010","")

$gl=inputbox("New letter file","Lockbox Name:","FICSGLDATA","")

WinActivate("Sym 000 - Episys - Letter File Control - ")

Sleep(1000)

Send("!fr")

WinActivate("Rename")

Sleep(2000)

Send($oldfile)

Send("{TAB}")

Send($gl)

;Send("{ENTER}")

;MsgBox(64, "Rename Successful", "Rename FICSGLDATA successful!")

;###################################

;###################################

;###########################################################

EndSelect

WEnd

EndFunc ;==>Example

Share this post


Link to post
Share on other sites

Might want to look at ControlSend(). Might be a little safer than Send() and Sleep().


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0