sandeb Posted May 17, 2007 Share Posted May 17, 2007 Hi People... I'm New To Scripting & Mainly In Autoit... I Went Through The Functions & In A Few Hours What I Find Is Something Like... Opt("WinTitleMatchMode", 2) WinActivate( "EDGAR Pro") # My Firefox Window (Not The Exact Name) & A pdf Is Open Here..... ControlClick("EDGAR Pro", "", 25, 62, 16) or Insteed Of The last Line ControlClick("EDGAR Pro", "", "[CLASS:AVL_AVView; TEXT:AVToolBarEasel; INSTANCE:25]", 62, 16) These Controls I Got From Autoit Window Info Tool... Will You Pls Help To Solve It... Or Something Else Like MouseClick.... Thanks For Paying Attention... Link to comment Share on other sites More sharing options...
Davo Posted May 17, 2007 Share Posted May 17, 2007 well there is a few different methods, firstly you could use a mouseclick to click the button, obviously, however this means that if the page moves or resizes your mouse won't be clicking the right point. A workaround is to move the window to a known location everytime so that the button is always at the same coordinates. use the WinMove() function. Once you have done this you can find the coordinates of the button and use MouseClick() function. The other posible way, (if it applies in your case) is to use shortcut keys. eg Alt+S or whatever the case may be if there is a case like that so you would use the send() function and send in the appropriate keys. Hope it helps. Dave ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------"I don't need to know everything, I just need to know where to find it when I need it"....EinsteinAnd in our case... That's the AutoIT helpfile ;) Please read before posting!!! Link to comment Share on other sites More sharing options...
MHz Posted May 17, 2007 Share Posted May 17, 2007 Welcome, Perhaps the accelerator keys maybe best. An example below. WinWait('How To Click On The "Save A Copy" Button') WinActivate('How To Click On The "Save A Copy" Button') WinWaitActive('How To Click On The "Save A Copy" Button') ControlSend('How To Click On The "Save A Copy" Button', '', '', '{ALT DOWN}fa{ALT UP}') That should open the SaveAs window. Tested in Firefox. Link to comment Share on other sites More sharing options...
sandeb Posted May 17, 2007 Author Share Posted May 17, 2007 (edited) Thanks Davo... 1st Of All As pdf Is Opened Inside An IE Frame... No Shortcut Key Will Work To Save The pdf As Insteed Of It Will Save The html... & As You Explains, Just For That Reason I Don't Wanna Use MouseClick() Is It Not Possible By ControlClick() !!! @ MHz: As I Said The pdf Is Inside A Frame, So Alt+F+S Will Produce Only The html Of The Page... & By The Way When I Run Your Code It Just Waits In The Very First WinWait Line & Do Nothing... :dunno: I Think As The Window "Save A Copy" Is Never Get Activated Before It... & Thanks For Your Warm Welcome... Edited May 17, 2007 by sandeb Link to comment Share on other sites More sharing options...
Davo Posted May 17, 2007 Share Posted May 17, 2007 (edited) Its a bit hard for me as I don't run firefox to help you but try this code replace the x and y coord variables with the buttons coordinates Opt("WinTitleMatchMode", 2) Dim $xCoord = ;button x coord Dim $yCoord = ;button y coord Dim $initialWinPos WinActivate("EDGAR Pro") ;get the initial window size and position $initialWinPos = winGetPos("EDGAR Pro") ;move it to a known position so that the mouseclick always clicks the right point on the screen WinMove("EDGAR Pro","",0,0,@desktopwidth,@desktopheight) sleep(500) ;click the button MouseClick("left",$xCoord,$yCoord) WinWaitActive("title of the save as dialog") ;do whatever you need to do like putting in the filepath or whatever or where to save in ControlClick("the title of the saveasdialog","","the control id of the save button") ;restore the window to its previous size and position WinMove("EDGAR Pro","",$initialWinPos[0],$initialWinPos[1],$initialWinPos[3],$initialWinPos[4]) Hope this helps out Dave Edited May 17, 2007 by Davo ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------"I don't need to know everything, I just need to know where to find it when I need it"....EinsteinAnd in our case... That's the AutoIT helpfile ;) Please read before posting!!! Link to comment Share on other sites More sharing options...
MHz Posted May 17, 2007 Share Posted May 17, 2007 @ MHz: As I Said The pdf Is Inside A Frame, So Alt+F+S Will Produce Only The html Of The Page... & By The Way When I Run Your Code It Just Waits In The Very First WinWait Line & Do Nothing... :dunno: I Think As The Window "Save A Copy" Is Never Get Activated Before It...& Thanks For Your Warm Welcome...Sorry, I did not realize that the PDF was loaded within the browser but was considering the Save As PDF concept. You nay need to look at the UDFs of _IE... functions in the help file. These UDFs use Com so you actions will be as reliable as a ControlClick() on a Win32 Gui application. Type _IE in the index of the help file and you should see all the _IE... UDFs available to use. Link to comment Share on other sites More sharing options...
sandeb Posted May 17, 2007 Author Share Posted May 17, 2007 @ Davo: Thanks For The Code, Will Try It... @ MHz: No Problem... Link to comment Share on other sites More sharing options...
herewasplato Posted June 22, 2007 Share Posted June 22, 2007 (edited) Thanks for answering my PM on this thread...No matter where the PDF is coming from, you should be able to force it to open in an Adobe window and not in the browser/frame. I've never seen a situation where a PDF had to be opened within the frame... but there is always a first.Try this on your system (and then we will talk about other's systems): Open the Adobe Reader (I have version 8.1.0) go to Edit > Preferences > Under Categories, select Documents > place a check beside "Show each document in its own window..." [i think that the "restart" is only for the reader and not the OS.]Exit the reader and test your link of interest. It should open in its own window no matter how IE brought it to the computer. If that works as expected, then we might want to hunt down where the reader keeps that setting - maybe in the registry. We might be able to toggle it during the script and leave it as it was found before exiting the script.If that does not work - then like MHz said, the IE UDF might. From the help file go to the index tab and type in "IE" - start with the example....hope this helps... Edited June 25, 2007 by herewasplato [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
sandeb Posted June 25, 2007 Author Share Posted June 25, 2007 Thanks herewasplato.... Yes You Are Right As I'm Able To Open The pdf In Adobe Reader Just By Passing The Absolute Link To The Reader Open window... But I'm Now Opening The Absolute pdf Link In IE, And Using Send('!fs') To Save It... Thanks For The Reply... Link to comment Share on other sites More sharing options...
herewasplato Posted June 25, 2007 Share Posted June 25, 2007 Glad to help - hang around - it is a great community. [size="1"][font="Arial"].[u].[/u][/font][/size] 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