Jump to content

FindString always returns zero for combo box


Recommended Posts

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

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 by MrMitchell
Link to comment
Share on other sites

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 by rav3451
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...