Method: AutoItX3::ListView#find
- Defined in:
- lib/AutoItX3/control.rb
#find(string, sub_item = "") ⇒ Object
Searches for string and sub_item in self.
Parameters
string-
The string to look for.
sub_item-
(
"") The “colum” to look in. A 0-based integer index.
Return value
Returns the index of the found list item or false if it isn’t found.
Raises
- Au3Error
-
Control or window not found.
Example
p ctrl.find("file1.rb") #=> 3
p ctrl.find("15 KB", 3) #=> 2
p ctrl.find("nonexistant") #=> false
669 670 671 672 673 674 675 676 |
# File 'lib/AutoItX3/control.rb', line 669 def find(string, sub_item = "") res = send_command_to_list_view("FindItem", string, sub_item).to_i if res == -1 false else res end end |