File logo

Yes, Quit Xojo and started again, rebooted laptop completely, and still shows extension.
Have I got extension visible statement in wrong place? maybe and example?

Thanks Greg, I suspect my extension visible statement is in wrong place? an example maybe? I know its basic but I’m stuck here with something I know is simple.

Aha. In finder, using ‘get info’ I see the “Hide extension” is not set, and doing this, does in fact hide the extension immediately. So, its my code, I’m not doing this in the right place somehow. Can you help PLEASE?

I’m not sure you can tell the Finder to hide extensions from within a Xojo app. Not easily, anyway. Not using standard Xojo code. The extension is part of the filename, so you’ll have to keep adding that if that is what you want the files to have.

I don’t use extensions for the users’ databases, personally, but then there’s no reason for them to ever see them.

I thought this was a system wide setting?
ie you see extensions or you dont, rather than “dont show extensions just for Bill’s files”

OSX used to use hidden settings to determine a file type, and didnt need extensions at all.
When they moved to extensions, they became more like Windows, and then had ‘hide extensions’ to make it look like a Mac again.

Whats wrong with seeing the extension?

And I am slightly puzzled as to what more the OP needs.

  1. Have my SQLite databases show my logo: CHECK

  2. Don’t show the extension in the Finder: CHECK

What else is there?

This is all I did:

Dim f As FolderItem = SpecialFolder.Desktop.Child("test.txt")

Dim tos As TextOutputStream = TextOutputStream.Create(f)
tos.WriteLine "hello world"
tos.Close

f.ExtensionVisible = False

and it works as expected on my machine. Set it to True and the file has an extension. Set it to False and it doesn’t.

2020r2.1 running on macOS Big Sur.

1 Like

Greg, Thank you for this. I see what you’ve done and thought it the same as my code, but the difference is you have done f.extensionvisible = false AFTER a write to to the file. Is that the key to this, or does it also work just after
 Dim f As FolderItem = SpecialFolder.Desktop.Child(“test.txt”) ?

I mentioned this above

Works perfectly now, so thank you Greg for your patience and support.

1 Like