Error getting tags :
error 404Error getting tags :
error 404 fileType | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
fileType
Basics
Expander triangle
Type
Property
Syntax
set the fileType to creator & type
Introduced
1.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X
Security
None required
Summary
Specifies the creator and file type for any non-stack files a handler creates on a Mac OS or OS X system.
Examples

set the fileType to "ttxtTEXT" -- text file owned by SimpleText app

Additional Comments
Expander triangle

Use the fileType property to ensure that files that a standalone application creates are recognized by the operating system as belonging to the standalone.

Value:

The fileType is an eight-character string. The first four characters are the creator signature, and the last four are the file type.

Important! The file type and creator signature are case-sensitive.

Comments:

When a file is saved on a Mac OS or OS X system, a 4-character file type and 4-character creator signature are saved with it. The creator signature specifies which application owns the file. The application determines the file format from the file type; the type is also used to determine which applications (other than the owner) can work with the file.

The fileType property is used to set the file type and creator of files created by the open file command and of files created putting data into a file, binfile, or resfile URL that doesn't yet exist. (To specify the file type and creator for stack files your application creates with the save command, use the stackFileType property instead.)

This property has no effect on Unix and Windows systems.

Important! To avoid conflicts with other applications, register any new creator signatures with Apple Computer if you plan to distribute a stack or standalone application that uses this property. Apple maintains a registry of creator signatures on its web site at <http://developer.apple.com/dev/cftype/>.

User Comments
Expander triangle
User thumbnail
rodney@oceanbrowser.com
StarStarStarStarStar
Apr 23, 2009
Be aware that it is NOT sufficient simply to specify the correct file extension under OSX to ensure the file will open with the correct application. For example if you used open file to write to a file "test.html" then used launch file "test.html", it would open in Text Edit. You would first need to set the creator type to Safari or Firefox to ensure it is recognized as belonging to a web browser. E.g.

set fileType to "TEXTsfri"

before creating the file would make it owned by Safari.
User thumbnail
Mark Smith
StarStarStarStarStar
Jun 5, 2009
rodney is right, but because osx has various ways of linking documents with apps, if you

set the filetype to empty

, this forces osx to use the file extension, and so your .html document should open in your default browser.