Jump to content

CutePDF Save as dialog box


 Share

Recommended Posts

When i trying to print/save as pdf using cutePDF Writer, having an issue where the cutePDF Writer (https://www.cutepdf.com/Products/CutePDF/writer.asp) save as dialog box stays hidden until the user interacts (clicks some part of the screen or presses a key).

Here is Little example

#include <IE.au3>
$iname = "ExampleForm"
Local $oIE = _IE_Example("form")
_IELoadWait($oIE)
_IEAction ($oIE,"printdefault")
WinWait ("Save As", "Move up to CutePDF Pro and get advanced control over your PDF documents. Easily merge && split PDFs, add security, digital signature, stamps, bookmarks or header/footer, make booklets, n-Up, save PDF forms, scan to PDF and more!")
WinActivate ("Save As", "Move up to CutePDF Pro and get advanced control over your PDF documents. Easily merge && split PDFs, add security, digital signature, stamps, bookmarks or header/footer, make booklets, n-Up, save PDF forms, scan to PDF and more!")
ControlSetText("Save As", "", "[CLASS:Edit; INSTANCE:1]", $iname)

Its possible to show save as dialog box using autoit ? If Yes then How ?

But When i use Winwait without text and WinSetState Like this

#include <IE.au3>
$iname = "ExampleForm"
Local $oIE = _IE_Example("form")
_IELoadWait($oIE)
_IEAction ($oIE,"printdefault")
WinWait ("Save As")
WinSetState ("Save As", "", @SW_SHOW)
ControlSetText("Save As", "", "[CLASS:Edit; INSTANCE:1]", $iname)

save as dialog box showing but not properly because some interface does not showing until the user interacts (clicks some part of the screen or presses a key) and ControlSetText does not set a text.

Link to comment
Share on other sites

  • 4 weeks later...

I often work with Save As dialog boxes like this:

;~ "Get the handle of the save as dialog box"
Local saveAsWindow = WinWait("Save As", "")
;~ "Activate the window"
WinActivate($saveAsWindow, "")
;~ "Wait for it to actually be active"
WinWaitActive($saveAsWindow, "")
;~ "Try to set the control's text, if it fails..."
If Not ControlSetText($saveAsWindow, "", "[CLASS:Edit; INSTANCE:1]", @ScriptDir & "\temp.pdf") Then
    ;~ "... try with control send"
    ControlSend($saveAsWindow, "", "[CLASS:Edit; INSTANCE:1]", @ScriptDir & "\temp.pdf")
EndIf

Sometimes I can't get ControlSetText to work, so I check for an error and use control send if it fails. If everything fails, then you can try using SendKeepActive and Send, but that shouldn't happen.

 

Edited by seadoggie01
Comments are horrid in online syntax highlighter

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

7 hours ago, seadoggie01 said:

I often work with Save As dialog boxes like this:

;~ "Get the handle of the save as dialog box"
Local saveAsWindow = WinWait("Save As", "")
;~ "Activate the window"
WinActivate($saveAsWindow, "")
;~ "Wait for it to actually be active"
WinWaitActive($saveAsWindow, "")
;~ "Try to set the control's text, if it fails..."
If Not ControlSetText($saveAsWindow, "", "[CLASS:Edit; INSTANCE:1]", @ScriptDir & "\temp.pdf") Then
    ;~ "... try with control send"
    ControlSend($saveAsWindow, "", "[CLASS:Edit; INSTANCE:1]", @ScriptDir & "\temp.pdf")
EndIf

Sometimes I can't get ControlSetText to work, so I check for an error and use control send if it fails. If everything fails, then you can try using SendKeepActive and Send, but that shouldn't happen.

 

@seadoggie01 your problem and my problem is different. I have problem with cutepdf save as dialog.

Link to comment
Share on other sites

8 hours ago, jmp said:

@seadoggie01 your problem and my problem is different. I have problem with cutepdf save as dialog.

No, I'm not having an issue. I was posting some code that I use with "Save As" dialog boxes and I thought you might like to try it

All my code provided is Public Domain... but it may not work. ;) Use it, change it, break it, whatever you want.

Spoiler

My Humble Contributions:
Personal Function Documentation - A personal HelpFile for your functions
Acro.au3 UDF - Automating Acrobat Pro
ToDo Finder - Find #ToDo: lines in your scripts
UI-SimpleWrappers UDF - Use UI Automation more Simply-er
KeePass UDF - Automate KeePass, a password manager
InputBoxes - Simple Input boxes for various variable types

Link to comment
Share on other sites

9 hours ago, seadoggie01 said:

No, I'm not having an issue. I was posting some code that I use with "Save As" dialog boxes and I thought you might like to try it

But i am not facing with controlsend or controlset problems, i have problem to activate save as dialog.

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...