In a ListBox, I display the contents (name of the found items) from a user selected folder and I exclude:
a. Directories
b. Files whose names start wit a dot
c. Invisible files,
d. Alias (Link) files.
While these filters set in a If / End If block works fine on OS X it failed miserably on Windows 10.
The used code is:
If (AnEntryFI.Directory And (Right(AnEntryFI.Name,4) <> "rtfd")) Or Not AnEntryFI.Visible Or Left(AnEntryFI.Name,1) = "." Or AnEntryFI.Alias Then
// Do nothing in these cases
Else
// Code to add the AnEntryFI.Name into the ListBox
End If
(AnEntryFI.Directory And (Right(AnEntryFI.Name,4) <> "rtfd")) // Exclude Directories (Folder), but not OS Xs RTFD files *
Not AnEntryFI.Visible // Exclude invisible files
Left(AnEntryFI.Name,1) = "." // Exclude files whose name starts with a dot
AnEntryFI.Alias // Exclude Links (Alias)
Unfortunately, I get the Directory and Alias Names (and I do not had time to really check if invisible anddot prefixed files are displayed in the ListBox or not).
Am I right, wrong, Whatever ?
RTFD files are displayed as special rtf files (bundles), but are in reality folders (directories) on OS X, so when I excluded directories, I do not get my wonderful styled texts with images in my TextArea.
PS: I knew there was reasons why I stopped to use RTF with Xojo, but forgot why. Now I recall.
I forgot to put #If TargetCocoa around declares to Cocoa and get errors telling a library was missing (which library ?) when I started to debug the application on WIndows. Fortunately, it had only two MenuHandlers and two events to check code not a 30MB project file !
If so - exclude directories purely on the basis of f.directory being true ( no idea what RTFD files are ). Then, on Windows, f.trueitem name will have the extension “.lnk” - check against that for aliases.
“RTFD files cannot be opened properly by applications on Windows, which does not support the concept of bundles.”[/quote]
I read it, but the @Emile Schwarz ask how to find the files,no how will be opened…
As you can see, theis is the Windows Channel, but the application have to run under both OS X and Windows.
It was in a different Conversation that I wrote I have to provide two set fo data, one for each OS:
a. one set of rtfd files that will be displayed with images on OS X
b. a second set of rtf files for Windows (and apparently no images:( )
Channel confusion: this happens to me too, sometimes ;-
I nearly forgot: on OS X, one can ask the Finder to open RTFD files (as a Folder) and so, we can watch whats inside the RTFD bundle. I use that, sometimes, to change the rtf page settings and tab values )