Jump to content

Warning Dialog - Adobe Reader


Recommended Posts

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 Reader

Class: #32770

Position: 373, 424

Size: 462, 211

Style: 0x94C00000

ExStyle: 0x00000101

>>>> Control <<<<

Class: Static

Instance: 2

ID:

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, 461

Size: 384, 58

ControlClick Coords: 137, 30

Style: 0x50002100

ExStyle: 0x00000000

>>>> Mouse <<<<

Position: 570, 491

Cursor ID: 0

Color: 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 again

OK

Cancel

__________________________________________

Before I can do anything, I need to be able to detect it before I can proceed.

Method 1:

CODE
WinExists "[Class:#32770]",""
or

CODE
WinActive "[Class:#32770]",""

Method 3:

CODE
WinExists "","Do you want to continue?"
or

CODE
WinActive "","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?

post-24017-1181159663_thumb.jpg

Link to comment
Share on other sites

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:

CODE
require '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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...