Jump to content

Noob To Programming - Needs Simple Help.


Recommended Posts

I'm trying to run a script that opens an application then prints the file using Adobe Distiller.

If a file exist then a window will pop-up asking to Overwrite ? Yes No button.

What commands would I use to detect and write a If Then statement?

:think:

Link to comment
Share on other sites

Sorry for being too general.

When the Distiller program prints, if it detects a file with same name, a window will pop-up.

Now all I need is a command to detect if that window pops up and

Then run a command to click the Yes Button.

Here is some simple code:

.

.

.

WinWaitActive("Print Setup")

Send("!n")

Send("a")

Send("!z")

Send("1")

Send("!a")

WinWaitActive("Print Setup")

ControlCommand("Print Setup", "", "Button7", "Check", "")

WinWaitActive("Print")

ControlCommand("Print", "", "Button16", "Check", "")

WinWaitActive("Print")

ControlCommand("Print", "", "Button10", "Check", "")

WinWaitActive("Save PDF File As")

ControlFocus("Save PDF File As", "", "Edit1")

Send("c:\work\fabtest.pdf")

ControlCommand("Save PDF File As", "", "Button2", "Check", "")

Thanks!

Link to comment
Share on other sites

I have tried the WinGetText command to get definitive text for the pop-up.

It seems the Title of the window is the same as the parent window ("Save FDF File As").

So it seems that any command that I pass to execute a command on the ("Save FDF File As") window get executed on the parent.

Have anyone seen this?

Link to comment
Share on other sites

to you give me a shot of both with windows with save PDF file as?

you could possibly try

$size = WinGetClientSize("Save PDF File As")
MsgBox(0, "Active window's client size is (width,height):", $size[0] & " " & $size[1])

get there sizes then just do like an if $size[0] = NUMBER and $size[1] = NUMBER then

do something

Edited by thatsgreat2345
Link to comment
Share on other sites

possibly

$times = 0
While 1
$size = WinGetClientSize("Save PDF File As")
If $size[0] = 563 and $size[1] = 419 and $times = 0 Then
ControlFocus("Save PDF File As", "", "Edit1")
Send("c:\work\fabtest.pdf")
$times = 1
Elseif  $size[0] = 245 and $size[1] = 126 and $times = 1 Then
ControlCommand("Save PDF File As", "", "Button2", "Check", "")
$times = 2
wend
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...