shreeks 0 Posted May 16, 2011 Hi,I could automate the initiation of “Save as :” dialog box with default filename as SQL_S_data(refer line 1 of the code snippet). But couldn’t the automate the press of “Save” button. Below is the code that I’ve written for the same. Could anyone help on this. Note : Send(“{Enter}”) doesn’t work and is not sending “Enter” key functionality.Refer the picture for the further details. Learning is Lifelong! Share this post Link to post Share on other sites
SmOke_N 211 Posted May 16, 2011 (edited) Look at the Control* functions in the help file. Control* functions + AutoItInfo tool and you'll probably make quick work of it. (ControlClick() function to be more specific) Edit: This is of course assuming this is a 3rd party dialog box you're trying to manipulate. Edited May 16, 2011 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites
shreeks 0 Posted May 16, 2011 Sorry. I forgot to attach the code snippet.Below, is the same. Local $fname = FileSaveDialog("Save as :", @WORKINGDIR, "Excel file (*.xls)|Text file (*.csv)","","SQL_S_data.xls") ; save as in working dir Send("{Enter}") Learning is Lifelong! Share this post Link to post Share on other sites
shreeks 0 Posted May 16, 2011 Look at the Control* functions in the help file.Control* functions + AutoItInfo tool and you'll probably make quick work of it.(ControlClick() function to be more specific)Edit:This is of course assuming this is a 3rd party dialog box you're trying to manipulate.Hi,I tried using Control* functions + AutoItInfo tool but of no use. Secondly, the dialog box is the Save as: dialog of MS Excel. Learning is Lifelong! Share this post Link to post Share on other sites
jofun 0 Posted May 16, 2011 Hi shreeks, plz check, if the save button has the focus when sending {ENTER}, otherwise it won't work. (Just use the tab key to watch the cursor changing focus.) Share this post Link to post Share on other sites
shreeks 0 Posted May 16, 2011 (edited) Hi shreeks, plz check, if the save button has the focus when sending {ENTER}, otherwise it won't work. (Just use the tab key to watch the cursor changing focus.) Hi jo, I tried with three possibilities but couldn't. Option 1 : Local $fname = FileSaveDialog("Save as :", @WORKINGDIR, "Excel file (*.xls)|Text file (*.csv)","","SQL_S_data.xls") ; save as in working dir WinWaitActive ( "Save as :"); Send("!s") Option 2 : Local $fname = FileSaveDialog("Save as :", @WORKINGDIR, "Excel file (*.xls)|Text file (*.csv)","","SQL_S_data.xls") ; save as in working dir ControlFocus ( "Save as :", "&Save", 1 ) Send("{Enter}") Option 3: Local $fname = FileSaveDialog("Save as :", @WORKINGDIR, "Excel file (*.xls)|Text file (*.csv)","","SQL_S_data.xls") ; save as in working dir Send("{TAB}") Send("{TAB}") Send("{TAB}") Send("{Enter}") Edited May 16, 2011 by shreeks Learning is Lifelong! Share this post Link to post Share on other sites
SmOke_N 211 Posted May 16, 2011 FileOpenDialog stops your script basically until it receives a command. Why you would want to manipulate your own dialog box is beyond me. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Share this post Link to post Share on other sites
shreeks 0 Posted May 17, 2011 FileOpenDialog stops your script basically until it receives a command.Why you would want to manipulate your own dialog box is beyond me."FileOpenDialog stops your script basically until it receives a command." - Oops. I never knew. FileOpenDialog() opens a dialog box with "Save" button. I need to some how automate the click of "Save" button. Any ideas? You can refer the previous reply for the possible alternatives(code snippets) that I tried. Learning is Lifelong! Share this post Link to post Share on other sites
jofun 0 Posted May 17, 2011 Hi shreeks, it's just as SmOke_n wrote, script is paused while the dialog is shown(thus you would have to have a second script that closes your dialog box). And thinking a second about it, SmOke_n is also right with his comment *Why you would want to manipulate your own dialog box is beyond me*. Maybe you can tell us, what you are trying to achieve. jofun Share this post Link to post Share on other sites