Jump to content

silwerstar

Members
  • Posts

    5
  • Joined

  • Last visited

silwerstar's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Can somebody help me with the code for this issue or point out the mistake in my code?
  2. I have an application, wherein I get a "Save As" dialog-box. At times, if a file exists with the same name, then another dialog box comes in, with the same name "Save As". The following is the code, which I wrote but it doesn't work as expected. WinWait("Save As") WinWaitActive("Save As") ControlClick("Save As", "Save", "[CLASS:Button; TEXT:&Save; INSTANCE:2]") ControlSetText("Save As","","CLASS:Button; INSTANCE:2]",$file_name) SendKeepActive("Save As") Send("{ENTER}") sleep(4000) WinWaitActive("Save As","",3) If WinExists("Save As", "No") Then Send("{ENTER}") Endif If WinExists("Exit OmniPeek") Then Send("{ENTER}") Else sleep(2000) WinClose($closing_file) Endif The idea is to check if the second "Save As" dialog box comes and if does come in, then over-write the existing file. This however, doesn't seem to be working with the autoit script that I wrote.Can someone help me with this script? You can re-create the issue by using Notepad as well. Just have a file with a name abc.txt and try to save a file with the same name You will get another dialog box with the name "Save As".
  3. No it doesn't have any API to automate.
  4. Hi, WinActivate("Hello") WinWaitActive("Hello") send( ) ... some send commands in here Firstly, what is the difference between the two lines? Secondly, when I check the return value of WinActivate, autoit seems to have activated my application Hello but I don't see it having the focus/visible... a) Am I missing anything here? Should WinActivate be always followed by WinWaitActive? c) How do I ensure that the send commands that I give for the Hello application are executed only when the Hello GUI's main window is visible? Please help
  5. I am writing an autoit script which tends to open an application [Vision]. When this application is open, the script intends to access an option from the menu which in turn causes another window within the same application to be opened. After configuring and saving some settings, the control is again returned back to the main window in the application [Vision]. I intend to automate this whole thing using auto-it. However, WinActivate() behaves weirdly. I am not sure how to resolve this. Can someone help with it? The following is my code: Dim $num,$file_name,$opening_file $num = 1 $file_name = "Hello" $opening_file = "Vision - [" & $file_name & "]" Opt("WinTitleMatchMode", 2); AutoItSetOption ("TrayIconDebug", 1);0-off Local $pid_handle = ProcessExists("Vision.exe") If $pid_handle Then ProcessClose($pid_handle) Endif Run("C:\Program Files\Vision.exe") WinWait("Vision - [Start Page]") WinWaitActive("Vision") SendKeepActive("Vision") sleep(3000) Send("!f") Send("n") WinWait("Capture Options - ") WinWaitActive("Capture Options - ") SendKeepActive("Capture Options") ControlClick("Capture Options","",32494) sleep(1000) ControlSetText("Capture Options","",1487,$file_name,"") Send("{DOWN}") Send("{Tab}") WinActivate("Capture Options - ") ControlClick("Capture Options","",32494) sleep(1000) Send("{DOWN}{Tab}") ControlCommand("Capture Options","",1471,"ShowDropDown","") If $num = 1 Then ControlCommand("Capture Options","",1471,"SelectString","1 - here u go") Elseif $num = 2 Then ControlCommand("Capture Options","",1471,"SelectString","2 - blah blah..") EndIf sleep(2000) Send("{ENTER}") ControlClick("Capture Options", "", 1) sleep(1000) WinActivate("Vision") WinWaitActive("Vision") SendKeepActive("Vision") sleep(2000) Send("^!y") The problems that I face are as follows: a) Though the Vision.exe gets opened using the Run() command, if I happen to click on some other window [GUI/Desktop/Browser], the Vision GUI loses focus and the autoit script gets stuck up at WinWaitActive() line forever and never returns. Isn't the autoit supposed to bring the focus onto the Vision GUI by itself. This way, I see the whole of my automation script fail, if I happen to meddle with the system when it just about happened to open the Vision GUI. How do I fix this? As I said earlier, the flow that needs to happen is: Vision GUI gets opened. Using Alt F or similar commands, I happen to open another dialog box in the GUI. This causes some config settings to be applied. I save and I return back to the vision GUI main window. Now the problem that I face here is that sometimes the Vision GUI's main window is never activated by the autoit and here too I end up waiting on the WinWaitActive line. Isn;t it supposed to have activated Vision main window before reaching the second line? WinActivate("Vision") WinWaitActive("Vision") SendKeepActive("Vision") sleep(2000) Send("^!y") Please help!!
×
×
  • Create New...