ineedh3lp Posted December 22, 2011 Posted December 22, 2011 It seems that find item doesn't check for file extensions. This means that if I have two files with the same base name, only the first one is found. Got any suggestions as how to fix this? (Showing file extensions is not an option). Exmaple: I got these files: New File.jpg New File.m2ts New File.rw2 New File.xmp ControlListView('xplorer', '', '[CLASS:ATL:BrowserListView; INSTANCE:3]', "FindItem", "New File") ; Returns the index only for New File.jpg ControlListView('xplorer', '', '[CLASS:ATL:BrowserListView; INSTANCE:3]', "FindItem", "New File.jpg") ; Returns -1 because the column contains only the file base name and I'm searching for the file base name and extension.
KaFu Posted December 22, 2011 Posted December 22, 2011 (edited) Something like this might work... Global $sFile, $sExtension $iCount = ControlListView("xplorer", "", "[CLASS:ATL:BrowserListView; INSTANCE:3]", "GetItemCount") For $i = 0 To $iCount - 1 $sFile = ControlListView("xplorer", "", "[CLASS:ATL:BrowserListView; INSTANCE:3]", "GetText", $i, 1) ; set last param to the correct subitem column $sExtension = ControlListView("xplorer", "", "[CLASS:ATL:BrowserListView; INSTANCE:3]", "GetText", $i, 2) ; set last param to the correct subitem column ConsoleWrite($i & @TAB & $sFile & $sExtension & @CRLF) If $sFile & $sExtension = "New File.jpg" Then ConsoleWrite("+ New File.jpg found, Index = " & $i & @CRLF) EndIf Next Edited December 22, 2011 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
ineedh3lp Posted December 22, 2011 Author Posted December 22, 2011 (edited) Adjusted the subitem columns (1 to 0 and 2 to 1), added the dot in If $sFile & '.' & $sExtension = "New File.jpg" Then and it did the trick. Thank you once again for helping me! Edited December 22, 2011 by ineedh3lp
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