Rmedina4 Posted July 13, 2017 Share Posted July 13, 2017 Is there anyway I can create a log file after every time my program loops? I want each array that gets passed to get logged in a txt file so I know which parts have been completed after every loop. Here is my code: Thank you in advance! expandcollapse popup#include <File.au3> #include <Array.au3> #include <MsgBoxConstants.au3> #RequireAdmin AutoItSetOption('MouseCoordMode', 0) AutoItSetOption('SendKeyDelay', 7) Global $sParts = @ScriptDir & "\Symbol-look-with-prt.txt" ;~ String Variable pointing to Parts.txt file Global $aParts ;~ Array Variable _FileReadToArray($sParts, $aParts) For $i = 1 To $aParts[0] WinWait("Creo Parametric") WinActivate("Creo Parametric") sleep(2000) MouseClick('primary', 1300, 292, 1, 0) ;**************************************************************************************** ;This part of the code is for assigning a var to a part ;it stores the var then paste it into the search field and hits enter ; ;**************************************************************************************** ClipPut($aParts[$i]) Send('^v') Send("{ENTER}") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will show the results of ; the ClipPut ("Value") and will show the part in PDP ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(9000) WinWait("Creo Parametric") WinActivate("Creo Parametric") MouseClick('primary', 372, 595, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will click on the Action button ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(9000) WinWait("Creo Parametric") WinActivate("Creo Parametric") MouseClick('primary', 312, 366, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will click on the Action button, scroll ; down, right, enter then it will open in Creo and populate the 3D model ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(9000) Send('{DOWN}') Send('{RIGHT}') sleep(9000) Send("{ENTER}") Sleep(7000) Send("{ENTER}") Sleep(9000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and will click on the X button To ; Close the current window another way to do this is WinClose funtion ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MouseClick('Primary', 610, 84, 1, 0) Sleep(9000) Send('{DOWN 4}') Sleep(9000) Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") Sleep(9000) WinWait("[CLASS:Dialog]") WinActivate ("[CLASS:Dialog]") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and bring back the PDP search link ; Make sure to have MapKey created in Creo call it qq so when its called ; it will close the object in creo ; ; Another Mapkey that needs to be created is ss so it can bring up the PDP search ; site. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #comments-start This part of the script locates the Tools in Creo and clicks on Family Table #comments-end MouseClick('Primary', 610, 84, 1, 0) Sleep(5000) Send('{DOWN 4}') Sleep(5000) Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") Sleep(5000) WinWait("[CLASS:Dialog]") WinActivate ("[CLASS:Dialog]") Send("dft") ; nv tool tab WinWaitActive("[CLASS:Dialog]") MouseClick('Primary', 122, 53, 1, 0) Sleep(5000) ; this part is for the "Generate family table Columns" WinWaitActive("[CLASS:Dialog]") MouseClick('Primary', 610, 84, 1, 0) Sleep(5000) Send('{DOWN}') Sleep(5000) Send("{ENTER}") Sleep(5000) ; This part clicks on the manu load feature WinWaitActive("[CLASS:Dialog]") MouseClick('Primary', 610, 84, 1, 0) Sleep(5000) Send('{DOWN}') Send('{DOWN}') Send('{DOWN}') Sleep(5000) Send("{ENTER}") ; popup window after you click on the manu load button WinWait("Information") WinActivate("Information") Send("{ENTER}") ; in the search field it will enter the part.txt file and press enter WinWait("Select File") WinActivate("Select File") Send (StringTrimRight($aParts[$i], 4) &".txt") Sleep(5000) Send('{ENTER}') ; the status will appear and a dialog box will appear, click enter WinWait("Family Table Status") WinActivate("Family Table Status") Sleep(5000) Send ('{ENTER}') Sleep(5000) ;After the manu process is complete WinWaitActive("Information") Sleep(5000) Send("{ENTER}") Sleep (5000) WinWaitActive("[CLASS:Dialog]") Send("{CTRLDOWN}s{CTRLUP}") ;close object window ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes a if else function for things to be verify if needed ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Conflicts() Sleep(3000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes a Creo HotKey to quit object ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Send("qq") Sleep(5000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes a Creo HotKey open up the PDP search window ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Send("ss") Next Func Information () If WinActivate ("Information") Then Send("{ENTER}") Else EndIf EndFunc Func Conflicts() Sleep(5000) If WinActivate("Conflicts") Then WinWait("Conflicts") WinActivate("Conflicts") MouseClick('primary', 483, 104, 1, 0) Sleep(3000) Send('{DOWN}') Send('{DOWN}') Send("{ENTER}") WinWait("Conflicts") WinActivate("Conflicts") MouseClick('primary', 472, 318, 1, 0) Sleep(4000) Send("{CTRLDOWN}s{CTRLUP}") Else EndIf EndFunc Link to comment Share on other sites More sharing options...
Neutro Posted July 13, 2017 Share Posted July 13, 2017 (edited) Hi Rmedina, This is pretty simple! Fileopen() to create a file then Filewrite for each loop. Try this: expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <File.au3> #include <Array.au3> #include <MsgBoxConstants.au3> #RequireAdmin AutoItSetOption('MouseCoordMode', 0) AutoItSetOption('SendKeyDelay', 7) Global $sParts = @ScriptDir & "\Symbol-look-with-prt.txt" ;~ String Variable pointing to Parts.txt file Global $aParts ;~ Array Variable _FileReadToArray($sParts, $aParts) $log = Fileopen(@scriptdir & "\log.txt", 10) For $i = 1 To $aParts[0] FileWrite($log, "Starting loop " & $i & " - ") WinWait("Creo Parametric") WinActivate("Creo Parametric") sleep(2000) MouseClick('primary', 1300, 292, 1, 0) ;**************************************************************************************** ;This part of the code is for assigning a var to a part ;it stores the var then paste it into the search field and hits enter ; ;**************************************************************************************** ClipPut($aParts[$i]) Send('^v') Send("{ENTER}") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will show the results of ; the ClipPut ("Value") and will show the part in PDP ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(9000) WinWait("Creo Parametric") WinActivate("Creo Parametric") MouseClick('primary', 372, 595, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will click on the Action button ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(9000) WinWait("Creo Parametric") WinActivate("Creo Parametric") MouseClick('primary', 312, 366, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will click on the Action button, scroll ; down, right, enter then it will open in Creo and populate the 3D model ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(9000) Send('{DOWN}') Send('{RIGHT}') sleep(9000) Send("{ENTER}") Sleep(7000) Send("{ENTER}") Sleep(9000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and will click on the X button To ; Close the current window another way to do this is WinClose funtion ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MouseClick('Primary', 610, 84, 1, 0) Sleep(9000) Send('{DOWN 4}') Sleep(9000) Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") Sleep(9000) WinWait("[CLASS:Dialog]") WinActivate ("[CLASS:Dialog]") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and bring back the PDP search link ; Make sure to have MapKey created in Creo call it qq so when its called ; it will close the object in creo ; ; Another Mapkey that needs to be created is ss so it can bring up the PDP search ; site. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #comments-start This part of the script locates the Tools in Creo and clicks on Family Table #comments-end MouseClick('Primary', 610, 84, 1, 0) Sleep(5000) Send('{DOWN 4}') Sleep(5000) Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") Sleep(5000) WinWait("[CLASS:Dialog]") WinActivate ("[CLASS:Dialog]") Send("dft") ; nv tool tab WinWaitActive("[CLASS:Dialog]") MouseClick('Primary', 122, 53, 1, 0) Sleep(5000) ; this part is for the "Generate family table Columns" WinWaitActive("[CLASS:Dialog]") MouseClick('Primary', 610, 84, 1, 0) Sleep(5000) Send('{DOWN}') Sleep(5000) Send("{ENTER}") Sleep(5000) ; This part clicks on the manu load feature WinWaitActive("[CLASS:Dialog]") MouseClick('Primary', 610, 84, 1, 0) Sleep(5000) Send('{DOWN}') Send('{DOWN}') Send('{DOWN}') Sleep(5000) Send("{ENTER}") ; popup window after you click on the manu load button WinWait("Information") WinActivate("Information") Send("{ENTER}") ; in the search field it will enter the part.txt file and press enter WinWait("Select File") WinActivate("Select File") Send (StringTrimRight($aParts[$i], 4) &".txt") Sleep(5000) Send('{ENTER}') ; the status will appear and a dialog box will appear, click enter WinWait("Family Table Status") WinActivate("Family Table Status") Sleep(5000) Send ('{ENTER}') Sleep(5000) ;After the manu process is complete WinWaitActive("Information") Sleep(5000) Send("{ENTER}") Sleep (5000) WinWaitActive("[CLASS:Dialog]") Send("{CTRLDOWN}s{CTRLUP}") ;close object window ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes a if else function for things to be verify if needed ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Conflicts() Sleep(3000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes a Creo HotKey to quit object ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Send("qq") Sleep(5000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes a Creo HotKey open up the PDP search window ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Send("ss") FileWrite($log, "Ending loop " & $i & @CRLF) Next FileClose($log) Func Information () If WinActivate ("Information") Then Send("{ENTER}") Else EndIf EndFunc Func Conflicts() Sleep(5000) If WinActivate("Conflicts") Then WinWait("Conflicts") WinActivate("Conflicts") MouseClick('primary', 483, 104, 1, 0) Sleep(3000) Send('{DOWN}') Send('{DOWN}') Send("{ENTER}") WinWait("Conflicts") WinActivate("Conflicts") MouseClick('primary', 472, 318, 1, 0) Sleep(4000) Send("{CTRLDOWN}s{CTRLUP}") Else EndIf EndFunc Edited July 13, 2017 by Neutro Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
Trong Posted July 13, 2017 Share Posted July 13, 2017 simple checkout: FileWriteLine( "filelog.txt", "some think to keep" ) Regards, Link to comment Share on other sites More sharing options...
Rmedina4 Posted July 13, 2017 Author Share Posted July 13, 2017 I have another question how can I click on the ok button if it doesnt have a button in the get info tool. When I put my curse over the button it selects both area like shown below. Link to comment Share on other sites More sharing options...
Rmedina4 Posted July 13, 2017 Author Share Posted July 13, 2017 Btw I can't use the mouse coordinates either because they change if I get more or less conflict entrees. Link to comment Share on other sites More sharing options...
Neutro Posted July 14, 2017 Share Posted July 14, 2017 There might be a keyboard shortcut like alt + O to for the OK button? It's also a good idea to contact the support of the editor of the program as they might give you some other ways to automate your tasks by using command line. In last resort you can use the Fast Find (FF) udf to search the OK button and so be able to click it wherever it is shown. Identify active network connections and change DNS server - Easily export Windows network settings Clean temporary files from Windows users profiles directories - List Active Directory Groups members Export content of an Outlook mailbox to a PST file - File patch manager - IRC chat connect example Thanks again for your help Water! Link to comment Share on other sites More sharing options...
Rmedina4 Posted July 20, 2017 Author Share Posted July 20, 2017 expandcollapse popup#include <File.au3> #include <Array.au3> #include <MsgBoxConstants.au3> #RequireAdmin AutoItSetOption('MouseCoordMode', 0) AutoItSetOption('SendKeyDelay', 7) Global $sParts = @ScriptDir & "\connectors-prt.txt" ;~ String Variable pointing to Parts.txt file Global $aParts ;~ Array Variable _FileReadToArray($sParts, $aParts) $log = Fileopen(@scriptdir & "\log.txt", 10) For $i = 1 To $aParts[0] FileWrite($log, $aParts[$i]) WinWait("Creo Parametric") WinActivate("Creo Parametric") sleep(5000) MouseClick('primary', 1300, 292, 1, 0) ;**************************************************************************************** ;This part of the code is for assigning a var to a part ;it stores the var then paste it into the search field and hits enter ; ;**************************************************************************************** ClipPut($aParts[$i]) Send('^v') Sleep(2000) Send("{ENTER}") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will show the results of ; the ClipPut ("Value") and will show the part in PDP ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(9000) WinWait("Creo Parametric") WinActivate("Creo Parametric") MouseClick('Secondary', 415, 603, 1, 0) sleep(3000) Send('{DOWN}') sleep(1000) Send('{DOWN}') Send('{RIGHT}') sleep(3000) Send("{ENTER}") Information() Sleep (5000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes when select instance window comes up ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WinWait("Select Instance") WinActivate("Select Instance") Send("{ENTER}") Sleep(9000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and will click on the X button To ; Close the current window another way to do this is WinClose funtion ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WinWaitActive("[CLASS:Dialog]") Send("uf") MenuManager () sleep(5000) WinWait("[CLASS:Dialog]") WinActivate ("[CLASS:Dialog]") MouseClick('Primary', 610, 84, 1, 0) Sleep(9000) Send('{DOWN 4}') Sleep(9000) Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") Sleep(9000) WinWait("[CLASS:Dialog]") WinActivate ("[CLASS:Dialog]") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and bring back the PDP search link ; Make sure to have MapKey created in Creo call it qq so when its called ; it will close the object in creo ; ; Another Mapkey that needs to be created is ss so it can bring up the PDP search ; site. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #comments-start This part of the script locates the Tools in Creo and clicks on Family Table #comments-end MouseClick('Primary', 610, 84, 1, 0) Sleep(5000) Send('{DOWN 4}') Sleep(5000) Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") Sleep(5000) WinWait("[CLASS:Dialog]") WinActivate ("[CLASS:Dialog]") Send("dftt") ; nv tool tab WinWaitActive("[CLASS:Dialog]") MouseClick('Primary', 122, 53, 1, 0) Sleep(5000) ; this part is for the "Generate family table Columns" WinWaitActive("[CLASS:Dialog]") MouseClick('Primary', 610, 84, 1, 0) Sleep(5000) Send('{DOWN}') Sleep(5000) Send("{ENTER}") Sleep(5000) ; This part clicks on the manu load feature WinWaitActive("[CLASS:Dialog]") MouseClick('Primary', 610, 84, 1, 0) Sleep(5000) Send('{DOWN}') Send('{DOWN}') Send('{DOWN}') Sleep(5000) Send("{ENTER}") ; popup window after you click on the manu load button WinWait("Information") WinActivate("Information") Send("{ENTER}") ; in the search field it will enter the part.txt file and press enter WinWait("Select File") WinActivate("Select File") Send (StringTrimRight($aParts[$i], 4) &".txt") Sleep(5000) Send('{ENTER}') ; the status will appear and a dialog box will appear, click enter WinWait("Family Table Status") WinActivate("Family Table Status") Sleep(5000) Send ('{ENTER}') Sleep(5000) ;After the manu process is complete WinWaitActive("Information") Sleep(5000) Send("{ENTER}") Sleep (5000) WinWaitActive("[CLASS:Dialog]") Send("viv") ;Send ("vinst") ;Send("{CTRLDOWN}s{CTRLUP}") ;close object window ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes a if else function for things to be verify if needed ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;Conflicts() ;Sleep(3000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes a Creo HotKey to quit object ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;WinWaitActive("[CLASS:Dialog]") ;Send("qq") Sleep(5000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes a Creo HotKey open up the PDP search window ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WinWaitActive("[CLASS:Dialog]") Send("ss") FileWrite($log, @CRLF) Next FileClose($log) Func Information () If WinActivate ("Information") Then Send("{ENTER}") Else EndIf EndFunc Func MenuManager () If WinActivate ("Menu Manager") Then MouseClick('Primary', 66, 53, 1, 0) Sleep(2000) MouseClick('Primary', 55, 192, 1, 0) WinWaitActive("[CLASS:Dialog]") Send("qq") WinWaitActive("[CLASS:Dialog]") Send("ss") Next Else EndIf EndFunc is there anyway to create a function and in the function start the loop from the beginning. I want to have it so if the MenuManager function gets called and it follows the If statement it will go straight to the beginning of the script. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now