rav3451 Posted July 11, 2012 Share Posted July 11, 2012 Hi guys, Im new to Auto IT and have a question here In the following peice of code FindString always returns zero hence the statement within the If loop is not executed If ControlCommand('Save As', '', "[CLASS:ComboBox; INSTANCE:2]", "FindString", 'All Files')<> 0 Then ControlCommand('Save As', '', "[CLASS:ComboBox; INSTANCE:2]", "SelectString", 'All Files') EndIf but if i use the following line only ControlCommand('Save As', '', "[CLASS:ComboBox; INSTANCE:2]", "SelectString", 'All Files') All Files gets selected in the combo box.. the combo box which I am targeting is the one in the " Save As " window for Notepad. Any ideas why findstring always returns 0 ??? Link to comment Share on other sites More sharing options...
MrMitchell Posted July 11, 2012 Share Posted July 11, 2012 (edited) I believe it returns 0 because it is not finding "All Files". Maybe try searching for "All Files (*.*)" - and that's two spaces after files. Edit: It appears "SelectString" is flexible with whether you specify the exact string or not, whereas "FindString" needs to find an exact string. Edit2: Just a guess though, could be (and I often am) wrong! Edited July 11, 2012 by MrMitchell Link to comment Share on other sites More sharing options...
rav3451 Posted July 11, 2012 Author Share Posted July 11, 2012 (edited) Hey MrMitchell, Thanks for the Idea.. Well "All Files (*.*)" didnt work for me but "All Files " with a single space after Files did .. thanks for the idea though Edited July 11, 2012 by rav3451 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