Sign in to follow this  
Followers 0
rav3451

FindString always returns zero for combo box

3 posts in this topic

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 ???

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by MrMitchell

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by rav3451

Share this post


Link to post
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
Sign in to follow this  
Followers 0