Force Extension when saving- workaround doesnt!

Run time error

Your Code runs without errors for me. I’ve tested it with 2018r3 under macOS Big Sur.

You can download the sample project here: https://www.dropbox.com/s/87tji8umkwivsu6/13.02.2021%20-%20Jeff.xojo_binary_project?dl=1

Well, it’s good that it works for someone. :slight_smile:

I put your FileTypes into my project
I put your code into my project
And I get the same error.

Clearly the project is messed up due to having tried to downgrade the code to 2018 from a 2020 start.
I blame API2.
Not sure how to ‘clean it up’ at this point.
Im getting tired of rewriting this code.

Edit: Saving the project in XML format and re-opening has stopped the error,
Interesting…

1 Like

Another similar solution would have been this:

  If Right(f.name,4) <> ".PDF" Then 
    f = f.Parent.Child(f.name+".pdf")
  End If

No, but it refers to a FileType (to my great surprise) created using Xojo default’s value (Xojo 2015r1).
I use the above string to test with f.Type if Ihave a wanted (or not) file. *

Of course, I do not know if this works with the current Xojo, I usually boot on El Capitan.

  • If a FileType uses MACS (as in folder/any default FileType in 2015r1), an unknow file type will return that entry if tested with f.MacType. This is different in a recent (the last ?) Xojo who returns “Untitled” if no File Type is set for that file.