Sign in to follow this  
Followers 0
zergling

Noob To Programming - Needs Simple Help.

11 posts in this topic

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:

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

check out runwait, NVM fileprnts only going to work if you can open it in notepad, but u said u wanted to print it with whatever the heck adobe distiller is, and fileexist and control click

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

Welcome to thr forums

normally you show us some code... then we help you

search help for

WinExists()

Msgbox()

8)


NEWHeader1.png

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

so did u get it or not?, it looks like u did with the winwaitactive for save pdf file as

Edited by thatsgreat2345

Share this post


Link to post
Share on other sites

you could probably use.. send("^p")

btw anyone know why

send("{lctrl}+{p}") doesn't open the print dialog in sciTe?

off topic i know..

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

o haha nvm doenst work :think:

Edited by thatsgreat2345

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Parent window:

Child (Pop-up if file already exist) window:

Edited by zergling

Share this post


Link to post
Share on other sites

#11 ·  Posted

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0