Jump to content

BeakerMcChemist

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by BeakerMcChemist

  1. I need to select a menu item using WinMenuSelectItem, but the menu item name changes depending on the name of the file open. However it always has the word "Movie" near the beginning. I tried to set WinTitleMatchMode =2, but as far as I can tell that only works on the Window Title, not menu items. This code works: WinMenuSelectItem($sProgName,"", "&Window", "&2 Movie water drops.mdb 8/25/2015 10:05:27 AM by CA System") But I would like to be able to use something like this and have the program pick the menu item that has the word "Movie" in it. WinMenuSelectItem($sProgName,"", "&Window", "Movie") I know WinMenuSelectItem works because I use it elsewhere in the program.
  2. AH! Now I see. I was lucky that the files just happened to be in alphabetical order. So the largest value was coincidentally the highest index. But on another set of files I had a different naming scheme and it was not in order. Thank you for the enlightenment.
  3. Thank you! That worked. Though I did not see where in the help file it talks about the limitations of _ArrayMaxIndex.
  4. I have an AutoIt script that lets the user choose a folder containing the files, then processes the files one by one in an image processing program. It creates an array of file names and opens the files one at a time. When I have a folder with 50 files or more, the script quits right after making the array. If I have 49 or less, it works perfectly. The code is below. I have a Windows 7, 64 bit system. I tried compiling it in 32 and 64 bit versions and it did the same thing. Is there any reason why it should not work? Or is there a better way to pick files and go through the list one at a time? ;Define some variables upfront $ProgName = "Fta32 Video 2.1" $ProgAddress = "C:\Program Files (x86)\Fta32\FTA32.exe" ChooseFolder() $filesList = _FileListToArray ($sFileSelectFolder,"*.mdb") WinActivate ($ProgName) ;_ArrayDisplay ($filesList) For $j = 1 to _ArrayMaxIndex($filesList) ;Code to process files Next Func ChooseFolder() ; Create a constant variable in Local scope of the message to display in FileSelectFolder. Local Const $sMessage = "Select a folder" ; Display an open dialog to select a file. Global $sFileSelectFolder = FileSelectFolder($sMessage, "") If @error Then ; Display the error message. MsgBox($MB_SYSTEMMODAL, "", "No folder was selected.") Exit EndIf EndFunc
×
×
  • Create New...