Build settings for Mac OSX - feedback

Steve King st.king42 at ntlworld.com
Fri Jul 9 12:14:44 EDT 2010


Hi Jacqueline & Bob

I think the version is 10.5.3? But this was just from a very quick glance
and I will have to check again. It was very lpeasing it just ran though.

Yes, I meant Answer file (not ask). I do use qualifier extensions in answer
dialogue but I will check exactly how I have defined this. It looks like I
will have to change the SAC one for mac, but this isn't a big deal.

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 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?
If I save my files with the extension, do I then stil need to use   'set the
filetype to "SACp"'?

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.

Cheers
Steve

----------------------------------------------------------
J. Landman Gay wrote

Steve King wrote:

> The execution bit. Interestingly, this wasn't needed. I just dragged the
> bundle over (as created by Rev using guidance from Jacqueline) and double
> clicked the executable and it ran all on its own!

Cool. Do you know which version of OS X he's running? I wonder if that 
makes a difference.

> 
> The problem. My application is built to save two files (text) with
> extensions SAC and SACp. These are saved (in windows) in a folder under my
> documents so I use specialfolderpath for this. The files save though not
> quite in the right place, but this is probably due to some minor fix I
need
> to make with specialfolders.

They should work identically, except on OS X the folder is called 
"Documents" instead of "My Documents". If you put the function's return 
value into a variable and use it that way, it should behave exactly as 
it does on Windows.

> The problem is loading them back. When I use
> the ask prompt, the saved file is present in the dialogue box but in light
> grey so I can't select it (click on it) to load it. I have another file
> (preferences) that the program saves and loads itself and interestingly
this
> works seemlessly, so it seems to be only a problem when using the
dialogue.
> Is it something to do wioth doc types and extensions? In the builder I
> declared Type and extension as SAC, SACP.

Since you're asking the use to choose an existing file, you mean the 
"answer file" command, right? The "ask file" command is for creating new 
files.

The dimming is probably due to the file selectors you're passing in 
answer file. The syntax that works on both platforms is:

   answer file <prompt> with type "<File tag>|SAC,SACp|SACSACp"

The last bit is the file types you put in your plist, with no spaces 
between. They don't need spaces or delimiters because all file type 
codes are exactly 4 characters. But -- big but -- the "SAC" type is only 
three characters so it won't work. You can have different Mac file types 
from their equivalent Windows extensions. If you add another character 
to SAC you don't necessarily have to add it to the Windows extension too.

Also, unless you've actually created your files with those file types 
assigned, the file dialog may not recognize them anyway, and they'll be 
dimmed as you describe.

You can either change your scripts to write files with the correct file 
types before you create them, or you can leave off the file specifier in 
the "answer file" command and hope your users choose the right kind of 
file. You could do some error checking when the file opens in that case 
to see if they did.

To save your files with a Mac file type, add this line somewhere before 
you do any file saving operations:

  set the filetype to "SACp" -- or SAC, but add another character

This also works with regular open/write/close file commands. It does not 
work with stacks; to set the filetype of a stack, use the stackFileType 
in the same way. You can set the filetype once on openstack and it will 
stay that way until you change it. You don't need it before every file 
save unless each one needs a different file type. Windows and Linux will 
ignore the command, it's Mac-only.

**********************************************




More information about the use-livecode mailing list