LondonNDIB Posted September 11, 2007 Share Posted September 11, 2007 I'm trying to automate a process - interacting with the web based shipping software at my shipper's site. I got most of the way... the very final step is it displays a webpage with two frames - the lower of which is a PDF document, so the adobe activex takes over and displays it. I just want to print that. I thought I could use something like: #include <IE.au3> $oIE = _IECreate ( "http://thepage.com" ) $oFrame = _IEFrameGetObjByName ( $oIE, "viewLabel" ) _IEAction ( $oFrame, "printdefault" ) But it says its an invalid object, so I guess frames can't be used. Anything you can think of? Another option, if it is easier, is to SAVE the pdf, but again I can't seem to get that to work. It just wants to save the HTML of the frameset page. Thanks. LD Link to comment Share on other sites More sharing options...
LondonNDIB Posted September 11, 2007 Author Share Posted September 11, 2007 I thought I figured out something using window controls:ControlClick ( "Shipping label", "", "[CLASS:AVL_AVView; INSTANCE:26]", "left", 1, 25, 20 ) But its weird... I can SEE it click the button! But the resulting print dialogue doesn't come up!!! However, if I click it manually, it does! The button flashes like its been clicked, but nothing happens. Same with Save or any of the other controls - they react (look like a mouse clicked it) but nothing happens until I do it manually. LD Link to comment Share on other sites More sharing options...
DaleHohm Posted September 11, 2007 Share Posted September 11, 2007 You'll need to continue with the ideas in your reply. IE.au3 acts on the browser DOM hosted inside IE. The PDF control is hosted inside IE in the same way that a document with the DOM is and does not offer the same object model, thus is not supported by IE.au3. Dale p.s. sorry, don't have an answer for your click problem Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
LondonNDIB Posted September 11, 2007 Author Share Posted September 11, 2007 Alright, thanks! This works!$mousepos = ControlGetPos ( "Shipping label", "", "[CLASS:AVL_AVView; INSTANCE:26]" ) Opt ( "MouseCoordMode", 0 ) MouseClick ( "left", $mousepos[0] + 25, $mousepos[1] + 40, 1, 0 ) Its a bit messy, and I wouldn't want to do this if it were meant for various systems - but because it is for automating my own task on my own machine, I'm happy with it. LD Link to comment Share on other sites More sharing options...
ptrex Posted September 12, 2007 Share Posted September 12, 2007 (edited) @LondonNDIB This gives you an PDF reader in a au3 Gui. It might give you a start on getting it going. expandcollapse popup#include <GUIConstants.au3> #NoTrayIcon ;Vars Dim $oMyError Dim $File Dim $Version ;Declare objects $oPDF = ObjCreate("AcroPDF.PDF") $File="C:\Reader.pdf" $Version=$oPDF.GetVersions ;Main Gui GuiCreate("PDF Object", 802, 590,(@DesktopWidth-802)/2, (@DesktopHeight-590)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $GUI_ActiveX = GUICtrlCreateObj ($oPDF, 10, 10 , 780 , 550) GUICtrlSetStyle ( $GUI_ActiveX, $WS_VISIBLE ) GUICtrlSetResizing ($GUI_ActiveX,$GUI_DOCKAUTO) ; Auto Resize Object GuiSetState() MsgBox(0,"Show Versions",$Version) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd $oPDF = "" $GUIActiveX = "" Exit ;This is SvenP 's custom error handler Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Regards, ptrex Edited September 12, 2007 by ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New 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