Jump to content

steveellis99

Members
  • Posts

    6
  • Joined

  • Last visited

steveellis99's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. Given the date of hte post, this might be useless to the original psoter, but for anyone else searching the forums and wondering about the answer... The crash above was caused because the poster didn't pass the text selection object to the SetTextSelection... $selection = $PDDoc.CreateTextSelect(0,$acroRect) $return = $oAcrobat.SetTextSelection($select) $return = $oAcrobat.ShowTextSelect() $return = $oApp.MenuItemExecute("Copy") And you'd have the contents of the selection rectangle in the clipboard..."text = Clipget() Hope this helps somebody at some point.
  2. I had started there a while back and actually got an embedded version of the Acrobat Reader working OK based on that example. The challenge has been how to embed the actual Acrobat window (because more of the IAC controls are available through AcroExch than the AcroReader). The OpenInWindowEx is supposed to do the trick...but so far not for me. My other scripts to drive and control actual Acrobat windos work fine, so it doesn't seem like and Acrobat installation problem. Many thanks for the feedback and suggestions.
  3. Ultimately, I'd want to display and navigate through the document (Find target words and move through). But just displaying would be a big step forward for me! I'm workign with a pretty restricted environment, so we can't install other PDF readers and such. It has to work with/through Acrobat.
  4. Greetings all, I'm wondering if anyone can post a sample script/snippet of working AutoIT code that opens a PDF into an AutoIT GUI? I have Acrobat professional installed and can use the object methods to drive most parts, but I have been simply unable to get the AVDoc.OpenInWindowEx method to work. I can use the DrawEx, but can't figure out what's wrong with actually opening a file in the window. The stripped-down test code I'm using (below) draws the GUI OK, but then crashes saying "The requested action with this method has failed." Then there's a bit of a line with AutoIT3.exe ended.rc:1. I get the same error whether the OpenInWindowEx attempt is before or after the @SW_Show. I'm quite a newbie with all this, but have been searching to no avail here and on the SDK forums. Thanks, in advance, for any help anyone can provide. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase $sFile="C:\My Documents\AutoIt\Test\Test.pdf" $oApp = ObjCreate("AcroExch.App") $oAcrobat = ObjCreate("AcroExch.AVDoc") $hGUI=GUICreate("TestApp", 1225, 900,0,0,$WS_CLIPCHILDREN) $GUI_ActiveX = GUICtrlCreateObj($oApp, 10, 10, 800, 875) GUISetState (@SW_SHOW) sleep(2000) $result = $oAcrobat.OpenInWindowEx($sFile,$GUI_ActiveX,"AV_DOC_VIEW",0,0,0,0,0,0,0)
  5. My code was created for Windows XP with IE8, but I think the basic idea would work for any version. You might have to use the AutoIT Window Info toolto get the right names for the Edit field and the buttons. The Save As dialog seems to be a Windows window (?!?!) not specifically an IE window, so I think they'll stay consistently named (I HOPE they stay consistently named!)
  6. Greetings all, After having recieved and absolute ton of assistance from all the user posts here, I feel obliged to share a bit of code I created to interact with the file-download dialog in IE. There might be better/easier ways, but I sure couldn't find them...or make them work in AutoIT as a newbie. I know there is an INetGet tool, but it won't work on the pages I'm using (security stuff...dynamic linking and my general ignorance). The code below will change the default text to a directory name, click the button, and replace the original file name back into the box. It's probably the equivalent of digital duct-tape, but I hope it can help somebody. Note: I have the destination directory stored in a variable ($dest) from a FileSelectFolder call. I'm not sure all the sleep() steps are essential, but it doesn't hurt ot have a little patience. ....after having a link clicked elsewhere in the script....snip: WinWait("File Download") WinActivate("File Download") sleep(500) ControlClick("File Download","","Button2") ; this clicks the default "save" button on the first dialog WinWait("Save As") ; Wait for the "Save As" box to pop up WinActivate("Save As") sleep(500) $filename=ControlGetText("Save As","Save &in:","Edit1") ;Get the file name before we erase it ControlSetText("Save As","Save &in:","Edit1","") ; erase the file name to make room for the $dest string sleep(1000) ControlSetText("Save As","Save &in:","Edit1", $dest) ; set the Edit1 text to the $dest and hit the button to swithc directories. ControlClick("Save As","","Button2") sleep(1000) ControlSetText("Save As","Save &in:","Edit1", $filename) ; reset the name of the file to the original value. sleep(1000) ControlClick("Save As","","Button2")
×
×
  • Create New...