Each OS (AFAIK) have service files (.DS_Store, Thumbsdb, etc.)
In my test project (the one I use with 2018r1), I drop a folder on the main window and the application process itscontents.
I use .TrueItem to scan that folder contents nd found a personal problem I have troubles to solve.
The example below is an adaptation of an Example from FolderItem.Item, but displays my problem.
BTW: skip the “it does not works” if this is the case: it only displays how I load the files from that folder (by 6 images).
The problem ? In that folder (and even if I do not open it), on MacOS, I have a Service file (.DS_Store) that is loaded instead of an image. In y test folder, it is .TrueItem(1); but this is not important. *
The actual result of my code is a missing image in page 1, then an error in all subsequent pages, just because of the presence of a file I do not want.
I have been on the bridge since this morning on this subject and I have not found a solution. Does somebody have an idea ?
[code]Dim itemIdx, dirCount, ImgIdx As Integer
Dim dir, item As FolderItem
dir = SpecialFolder.Desktop
dirCount = dir.Count
For itemIdx = 1 To dirCount step 6
For ImgIdx = 1 to 6 // Load all 6 images here
item = dir.TrueItem(itemIdx + ImgIdx)
If item <> Nil Then
Me.AddRow “[” + Str(ImgIdx) + “]” + item.DisplayName // Imagine this line load and print the lmage file
Me.AddRow “” // Simulate a form feed
I print in the generated pdf the first image in the front page, that is why I know this service file position in the folder
This trouble I resolved by my own.
If .TrueItem(1) name is ".DS_Store’, then load .TrueItem(2), basically, hoppin only one service file there / .TrueItem(2) is my first image file.
Edit: modified the code because it have too many errors