shreeks Posted May 16, 2011 Share 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! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 16, 2011 Moderators Share 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. Link to comment Share on other sites More sharing options...
shreeks Posted May 16, 2011 Author Share 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! Link to comment Share on other sites More sharing options...
shreeks Posted May 16, 2011 Author Share 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! Link to comment Share on other sites More sharing options...
jofun Posted May 16, 2011 Share 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.) Link to comment Share on other sites More sharing options...
shreeks Posted May 16, 2011 Author Share 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! Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted May 16, 2011 Moderators Share 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. Link to comment Share on other sites More sharing options...
shreeks Posted May 17, 2011 Author Share 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! Link to comment Share on other sites More sharing options...
jofun Posted May 17, 2011 Share 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 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