keashdoc Posted September 17, 2011 Share Posted September 17, 2011 Hi, I am trying to automate Adobe Acrobat 9 Standard (running on Windows 7 home) to digitally sign documents. I have created the following script. ; ShellExecute("c:\esign\tosign.pdf") if winwaitactive("tosign","",30) then Winsetstate("tosign","",@SW_MAXIMIZE) sleep(300) ;MouseClick("left", 100, 100, 2) WinSetOnTop("tosign", "", 1) sendkeepactive("tosign") send("^0") sleep(300) send("^+{END}") sleep(300) ;send("!") ;sleep(500) ;send("D") ;mouseclick("left",460,60) ;send("!D") ;sleep(100) send("{ALT}+A") sleep(400) send("S") sleep(400) send("P") sleep(1000) ; WinSetOnTop("tosign", "", 1) ;mouseclickdrag("left",650,1100,1100,1130) sleep(500) ; sleep(200) ; send("{ENTER}") ; sleep(1000) ; send("c:\esign\signed.pdf") ; send("{ENTER}") ; sleep(1000) ;winclose("tosign") ;winclose("tosign") Else msgbox(0,"no","no") endif --------------------------------------------------------------------------------------------------------- When I run it, it opens the adobe, drops down the menu for signing and when the sign document dialog box comes up, it has lost focus and none of the commands are sent to that box. I have tried all sorts of trick - WinsetonTop, WaitWinActive and even clicking the mouse in the dialog box to get it to the forefront focus but nothing works. Does anyone have any idea how I can get the dialog box to stay at top and not loose focus? Thanks KEashdoc Link to comment Share on other sites More sharing options...
Beege Posted September 17, 2011 Share Posted September 17, 2011 Have you tried removing sendkeepactive("tosign")? That might be holding "tosign" as the active window when your box appears. Assembly Code: fasmg . fasm . BmpSearch . Au3 Syntax Highlighter . Bounce Multithreading Example . IDispatchASMUDFs: Explorer Frame . ITaskBarList . Scrolling Line Graph . Tray Icon Bar Graph . Explorer Listview . Wiimote . WinSnap . Flicker Free Labels . iTunesPrograms: Ftp Explorer . Snipster . Network Meter . Resistance Calculator 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