Build settings for Mac OSX - feedback

J. Landman Gay jacque at hyperactivesw.com
Fri Jul 9 13:20:22 EDT 2010


Steve King wrote:

> I declared the types in both the Document type and document extension part
> of the standalone builder, using comma separated SAC, SACp for both. Maybe
> this is not correct?

The entries in the standalone builder just tell Rev what to put in the 
plist it makes. It has no affect on the files your app creates and once 
the plist is made, the SB is finished with the info. You need to manage 
the filetypes yourself in your script when you write files to disk. In 
other words, you need both things: fill out the plist info, and set the 
filetype in your scripts.

The file system will consult the plist to see what files your app uses. 
Then it looks on disk to see if any of the files have that filetype 
assigned. Generally this only happens when a user double-clicks a file 
to open your app; the Finder looks at the plist to see what app to use 
to open the selected file.

In the answer file dialog, you control which entries are enabled by 
specifying a filetype. This doesn't really have to match your plist, Rev 
can open any kind of file, though generally you want only your app's 
files to be enabled.

There is one other trick for OS X. You can set the filetype in your 
script to "????". This is a special filetype that is something like a 
wildcard. If you use that, OS X will check the file extension to see 
what kind of file it is. So another way for you to do what you want is 
to set the filetype to "????" and use the "SAC" extension; that way you 
wouldn't have to add a fourth character to it.

> 
> The problem with the folders is a bit different.
> The structure I use is 
> Documents > SAC > Dives
>                 > Preferences
> And the SAC files are in Dives, the SACp in preferences. In windows this
> works as expected. In the mac I found all the files were in the SAC folder
> not the lower folders, but the Dives and Preferences folders were created by
> the application. When I save the files I save them with the appropriate
> extension. Is the "/" in the script the same way round in all platforms?

Yes. In fact, a slash is the only thing that will work in file paths for 
all Rev-related file functions. One thing to note is that 
specialFolderPath doesn't put a final slash on the folder name it 
returns. You need to add that in your script. So for your file path, 
you'd use:

   put specialFolderPath("documents") & "/SAC/Preferences/" & <short 
file name here.SAC>" into tPath

> If I save my files with the extension, do I then stil need to use   'set the
> filetype to "SACp"'?

As per above, you can use "????" to force OS X to read the extension for 
clues. But that won't change how your answer dialog appears. For that 
you need file type specifiers. The file dialog is just a visual 
representation and you control how it looks by telling it what types to 
show. If you specify a file type but your files haven't been assigned 
that type, then they will be dimmed.

However, if you write files to disk using the "????" filetype and then 
specify the SAC extension, then yes, those will show up in the file dialog.

Finally, I should probably mention that filetypes are case sensitive. 
"SAC" is different from "sac". Extensions are not case sensitive and the 
file dialog will enable the file either way.

> 
> I'll have a more careful look at the code and may have to borrow the Mac for
> a day to test a bit more.

Testing on the same OS you will deploy to is a must. So, good plan. :) 
Your debugging will go much faster that way too.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list