SorryButImaNewbie Posted November 12, 2014 Share Posted November 12, 2014 Have a good day dear reader! I'm writing a code to auto bug test in a realativly big system. I'm needed to save some results on PDF for that i use PDF creator 1.7.1 On different tests i usually copy my code and simply rewrite the part where it "names" the PDF before saving. My usuall "1st test" with any code that I check if it runs the same way 5 different times. (The very fact that I developed this habbit show how many times i run in to this) I usually need to do more then rewrite the name of the PDFs, sometimes I add Sleep or change the logic how i arrive to some kind of solution. The annoying thing is, when I start testing a code and I see it runs as I intended once-twice even third-time and then at the fourth-time It doesn't act as it should for some reason (in this particular instance It didn't get the ControlGetText) I don't know if there is something wrong with the way I use a command or what can i do to avoid this as much as possible Here is the code fragment I was talking about before it, the script create the data in the program for testing and the PDF creator automaticly started by the program Thank you for your noble help dear Sir/Brave Traveler! PS: I couldn't find any other thread about this, sorry if it has been answered already WinWaitActive("PDFCreator") Local $handle4 = WinGetHandle("PDFCreator", "") Sleep(5000) ControlFocus($handle4, "", "ThunderRT6TextBox5") Sleep(500) Local $VJdate = "TeszttVJ" & ControlGetText($handle4, "", "ThunderRT6TextBox5") MsgBox(0, "VJdate teszt", $VJdate) Sleep(1000) ControlSetText($handle4, "", "ThunderRT6TextBox6", $VJdate & "(1)EuroSztornó") Sleep(1000) ControlClick("PDFCreator 1.7.1", "", "[CLASSNN:ThunderRT6CommandButton7]") Sleep(2000) Send("{ENTER}") Sleep(1000) WinWaitActive("PDFCreator") Sleep(1000) Local $handle5 = WinGetHandle("PDFCreator", "") ControlSetText($handle5, "", "ThunderRT6TextBox6", $VJdate & "(2)EuroSztornó") Sleep(1000) ControlClick("PDFCreator 1.7.1", "", "[CLASSNN:ThunderRT6CommandButton7]") Sleep(2000) Send("{ENTER}") Link to comment Share on other sites More sharing options...
water Posted November 12, 2014 Share Posted November 12, 2014 IIRC PDFCreator has a COM interface. This means you do not need to automate the GUI but can reliable script PDFCreator via COM methods. A german web site states that starting with version 0.8.1 RC9 released in 2006 PDFCreater has this API. Starting with version 0.9.0 the installer offers to install additional COM examples. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 12, 2014 Author Share Posted November 12, 2014 But if the program automaticly opens the PDF creator, I can still use a COM interface to "tell" it what to do? Sorry I never used COM interface before (actually I just googled it, I learnt about it in university, but just that it's an interface between programs, or what ever else I already forgot) so I would prefer to use the basic autoit functions, since I see that it can work. Also I have to ask for permisson to download things (Not like I wouldn't get one for a COM interface) But thanks for the tip water, now i can at least search better about the topic Link to comment Share on other sites More sharing options...
jguinch Posted November 12, 2014 Share Posted November 12, 2014 It's also possible to create a dedicated printer and play with the Auto-Save and Actions options, to have a silent PDF printer Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
water Posted November 12, 2014 Share Posted November 12, 2014 But if the program automaticly opens the PDF creator, I can still use a COM interface to "tell" it what to do? Sorry I never used COM interface before (actually I just googled it, I learnt about it in university, but just that it's an interface between programs, or what ever else I already forgot) so I would prefer to use the basic autoit functions, since I see that it can work. Also I have to ask for permisson to download things (Not like I wouldn't get one for a COM interface) But thanks for the tip water, now i can at least search better about the topic AutoIt allows to attach to an already running instance of a program by using ObjGet. As far as I understand the web site you do not need to install any additional software to use COM. It is builtin. The installer just installs additional COM examples. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 12, 2014 Author Share Posted November 12, 2014 Thank you guys, you gave me valuable homework (any additional info is still welcome ofc) Link to comment Share on other sites More sharing options...
Bert Posted November 12, 2014 Share Posted November 12, 2014 Thank you guys, you gave me valuable homework (any additional info is still welcome ofc) BTW - you are NOT stupid! Your questions are articulated quite nicely and you know what you need to complete the task you desire. Don't put yourself down! The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
SorryButImaNewbie Posted November 12, 2014 Author Share Posted November 12, 2014 Thanks Bert! I only gave myself this name, because I was put in to a position where i have to work with autoit and the only education i got about it was the previus guy who showed it to me for a day, I used other languages but always object oriented, so Its a roundabout way of saying that I'm a newbie in it. However i really start to love it, its and incredibly versatile tool Link to comment Share on other sites More sharing options...
jguinch Posted November 12, 2014 Share Posted November 12, 2014 BTW, you can change your display name by SorryButImNewbie Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF 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