Desktop File Types Query

I don’t follow Emile, what do you mean by custom file types?
Currently, the only file types I have configured are the special/any and it rejects every file type out there when running on Windows while works fine under macOS. you’re right about the fact that on Mac it will accept a folder drop even if you do not specifically ask for them, but it’s pretty standard for me to sort those with If FolderItem.IsFolder Then, so I have no problem with this. I always prefer to get too much than have something missing :wink:

If you’re on the feedback system, you can check Case-64384 for a full description and Repro steps.

So, it’s a bug.

I believe so.
I even installed 2021r1 to make sure before I opened the case. Works excellent under macOS, do nothing whatsoever under Windows.
The problem is, given that I’m right and it is really a bug, now it will take forever until the fix, and that means no Windows version for this software until that happens.
The only other option/workaround is to manually add all the file types I can think of, pretty crazy if you think about it.

Not mandatory. Sometimes we can be surprised…

As always, only time will tell.

1 Like

From your mouth to the gods of bugfix :pray: hahaha

2 Likes

If you report the file type of a dragged item, you define something (the name of the file type…).

Do you know what FolderItem.Type may do for you ?
Of course, you have to define a file type in order to get that information returned with FolderItem.Type.

https://documentation.xojo.com/api/files/folderitem.html.Type

Could you post a screenshot of the special/any file type you’ve created?

Of course, but I didn’t change anything from the default special/any built-in preset (except for the Role attribute for the App.OpenDocument handler), so you might as well do it yourself in any project.

Well, if I understand your point there’s no need for that, as I created a global function and named it “FileType” that Extends f As FolderItem and returns a String.

Var ft() As String = f.NativePath.Split(".")
If ft.Ubound > -1 Then
  Var Last As int16 = ft.Ubound
  Return ft(Last)
End If
Return ""

Call it from anywhere just by writing: obj.FolderItem.FileType
Works like a charm, as long as the app lets the folderitem in of course :slight_smile:

BTW, you can simplify that code to

Var name as string = f.name
Return NthField(name, ".", CountFields(name, "."))
1 Like

Ok, I seem to remember that there’s something special that you need to do on Windows, but trying to remember what that is.

If there’s something special for Windows and it doesn’t interfere with macOS to work properly when it exists, then how come it is not included with the built-in special/any preset for complete cross-platform compatibility?

Anyhow, I’ll be forever grateful if you could remember what that was. :heart_eyes:

As I recall it’s not part of the file type but part of the AcceptFileDrop code. I’ll look when I get to my desk this morning.

I’ll highly appreciate it if you could find the time to look that out. :pray:

I like that, and I can simplify that code even furthermore:
Return f.name.NthField(".", f.name.CountFields("."))

Edit: I tried to be clever but it didn’t work :stuck_out_tongue:

1 Like

Please, read the important (for you) information in this thread:

Thank you, thank you, thank you for remembering me @Emile_Schwarz :heart_eyes:
It works like a charm after changing the special/any from .* into *.*

Happy to help. But Julian found the solution. I only send it to you.

1 Like

Yes, I noticed, but you made the connection to my case and sent me the rope, not trivial at all!

1 Like