Apophus 0 Posted November 24, 2020 I'm scratching my head raw trying to figure out what I'm doing wrong in the short script below causing the "Variable cannot be accessed" error #Include <File.au3> #Include <Array.au3> $idir = "D:\LittleOne Music\My IPOD" ; Get list of sub-folders in $idir $FolderList=_FileListToArray($iDir) $edl = $FolderList[0] ; $edl = number of sub-folders in $idir ; Now get a list of the files in each sub-folder - set $mdir to the name of the $dix(nth) sub-folder For $dix = 1 To $edl $mdir = $FolderList($dix) $FileList=_FileListToArray($mdir) ==> Variable cannot be accessed in this manner.Next Share this post Link to post Share on other sites
Danp2 909 Posted November 24, 2020 8 minutes ago, Apophus said: $mdir = $FolderList($dix) Change the parentheses to square brackets and it should work. 😎 [UDF] WebDriver Latest version Wiki FAQs Share this post Link to post Share on other sites
JLogan3o13 1,639 Posted November 24, 2020 (edited) Welcome to the forum. In short, your issue is you have no error checking. I see the likely issue, but this is a good learning opportunity. Does $mdir return what you would expect it to? Edit: Or forget the whole "Teach a Man to Fish" motto 😄 Edited November 24, 2020 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Share this post Link to post Share on other sites
Apophus 0 Posted November 28, 2020 On 11/24/2020 at 12:44 PM, Danp2 said: Change the parentheses to square brackets and it should work. 😎 Thank you. I was mistakenly sure that parentheses were the proper symbols to enclose a subscript. Hard to tell the difference on my laptop. I also didn't place the error message on the correct line; should have been on $mdir = $FolderList($dix) . Share this post Link to post Share on other sites