rancar2 Posted June 6, 2007 Share Posted June 6, 2007 I am fairly new to using AutoIt. I have attempted multiple methods for handling the warning dialog before a file is saved in Adobe Reader.The following is what is obtained from Window Info:__________________________________________>>>> Window <<<<Title: Adobe ReaderClass: #32770Position: 373, 424Size: 462, 211Style: 0x94C00000ExStyle: 0x00000101>>>> Control <<<<Class: StaticInstance: 2ID: Text: This document does not allow you to save any changes you have made to it unless you are using Adobe Acrobat 7.0 Standard or Adobe Acrobat 7.0 Professional. You will only be saving a copy of the original document. Do you want to continue?Position: 433, 461Size: 384, 58ControlClick Coords: 137, 30Style: 0x50002100ExStyle: 0x00000000>>>> Mouse <<<<Position: 570, 491Cursor ID: 0Color: 0xD4D0C8>>>> StatusBar <<<<>>>> Visible Text <<<<This document does not allow you to save any changes you have made to it unless you are using Adobe Acrobat 7.0 Standard or Adobe Acrobat 7.0 Professional. You will only be saving a copy of the original document. Do you want to continue?&Do not show this message againOKCancel__________________________________________Before I can do anything, I need to be able to detect it before I can proceed.Method 1:CODEWinExists "[Class:#32770]",""orCODEWinActive "[Class:#32770]",""Method 3:CODEWinExists "","Do you want to continue?"orCODEWinActive "","Do you want to continue?"Nothing I do seems to work. The save dialog box which comes after has the same class information and I am able to handle that. But I would like to be able to automatically handle this dialog box first. Any ideas? Link to comment Share on other sites More sharing options...
poisonkiller Posted June 6, 2007 Share Posted June 6, 2007 (edited) My question is: are you using AutoIt v2 or v3? From your code it looks like v2 and it has it's own forum. If you are using v3, then try using ControlSend(). Edited June 6, 2007 by poisonkiller Link to comment Share on other sites More sharing options...
rancar2 Posted June 6, 2007 Author Share Posted June 6, 2007 My question is: are you using AutoIt v2 or v3? From your code it looks like v2 and it has it's own forum. If you are using v3, then try using ControlSend(). I'm actually using Watir (written as Ruby) which uses the COM interface. When I posted the question, I changed the code to look more like what I thought it would if you just used AutoIt by itself. I guess I was wrong, but the syntax I was using for Watir did work. To solve the issue, I was trying to use the help file included in AutoItX v3. However, it was not as good as your advice. To handle the situation, I was able to implement what you had suggested in Watir. The following is a working snippet of the code: CODErequire 'win32ole' $autoit = WIN32OLE.new("AutoItX3.Control") $autoit.WinWaitActive("[Class:AdobeAcrobat]","") $autoit.Send("{SHIFTDOWN}{CTRLDOWN}s{CTRLUP}{SHIFTUP}") windowHandle=0 while windowHandle==0 warning_adobe=$autoit.ControlSend("[Class:#32770]","Do you want to continue?","[Class:Button;Text:OK]","{ENTER}") if warning_adobe==1 windowHandle=1 end end 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