Page 1 of 1

File Types on OSX

Posted: Mon May 12, 2008 6:43 pm
by reelstuff
I have an application that saves a file to a directory path defined by the user, I am having some trouble on the MAC side, as the associations are identified as text, when it should be identified as html.

I should mention that the Windows build of this application has no such issues and functions exactly as it should with the operating system identifying, each file type as required.

this includes, HTML, Javascript files, Zip Files, ect.

But on the MAC standalone, each file saved from the standalone is text only.

So when a file is saved from the standalone, it appears to MAC OSX as if it were in fact a text file, or in this case, an RTF file.

The same is true of downloading a ZIP file, which is saved to the users disk, as a binfile: the actual file is displayed and associated as a text file.

even though it is saved as binfile it still shows as a text file with the binary code contained inside the text file format.

I have tried a number of solutions, as well as consulting the user guide and dictionary, while there is some mention of the MAC osx File Types and Creators, there appears to be no solution mentioned that would allow me to do this in the REV IDE before compilation.

One mention in the docs stated that after building the standalone you should go into the bundle file and make changes to the bundle identifier.

This does not seem like the best solution.

I feel there must be a solution that could be initiated inside the REV IDE, something like

Code: Select all

if the platform is "MacOS" then 

--perhaps assign custom property? or some other solution that will allow 
--the OSX to see the correct file associations

else
--continue code that works on windows, index.html works just fine on windows
-- I think the problem here is that using "file:" outputs as text in MAC OSX
put myData into URL ("file:" & it & "/index.html")
anyone have any thoughts or ideas on this, I tried a couple of things, which did work in the IDE but when a standalone was built, it did not work nor did it create a file,

just curious if anyone has run into this and may have found a solution.

Tim

update

Posted: Wed May 14, 2008 9:03 am
by reelstuff
I found a solution, which turned out to be fairly easy if a bit weird.

I simply set the filetype to html then oddly enough, all the files were recognized by the system, I even got a couple of testers to confirm on MAC OSX leopard, and PPC systems.

Posted: Wed May 14, 2008 10:58 am
by Klaus
Hi TIm,

I always set the filetype to "" (empty) and never had problems with it.
This way, the Finder is forced to determine the correct "filetype" by checking the filesuffix.


Best

Klaus

Posted: Wed May 14, 2008 11:06 am
by reelstuff
Klaus wrote:Hi TIm,

I always set the filetype to "" (empty) and never had problems with it.
This way, the Finder is forced to determine the correct "filetype" by checking the filesuffix.


Best

Klaus
Thank you, that is a better way to do that, instead of setting each file type, the funny thing was that once I set the one file type, all the other file types except for zip, were recognized, but I like you method much better.

I will try that out.