saving and restoring field contents

mattiasa Mattias.Alveteg at chemeng.lth.se
Mon Dec 16 09:57:01 EST 2002


Ah, sorry

the answer was already out there (Thanks Ken Ray and Richard Gaskin):

function AppPath
   put the fileName of this stack into tPath
   set the itemDel to "/"
   if (IsOSX()) then
     get offset("Contents/MacOS/",tPath)
     if it > 0 then  -- MC 2.4.3 or later
       delete char it to len(tPath) of tPath
     end if
   end if
   return tPath
end AppPath

function IsOSX
   if the platform is not "MacOS" then return false
   get the systemVersion
   if item 1 of it >= 10 then return true
   return false
end IsOSX

On måndag, dec 16, 2002, at 15:21 Europe/Stockholm, mattiasa wrote:

> When closing a standalone stack I have, I would like all the 
> information I had in it's fields and all other settings (hilites of 
> radio buttons and check buttons) to  be remembered and to appear next 
> time I open this standalone stack.
>
> I've implemented this by saving all the information to a text file and 
> then reading that back in again. My problem is to find a good path for 
> such a file (especially since there might be duplicates of this stack 
> and each duplicate should preferably remember different settings).
>
> With Mac OS X I tried the following script to give me a name (putting 
> the file in the same folder as the standalone, thus assuming that the 
> logged in user is allowed to write in that folder).
>
> My script uses
>
> put filename of this stack into thename
>
> and then figures out in what folder (i.e. directory) it resides.
>
> It works fine as long as I don't make the stack standalone. A 
> standalone under Mac OS X is, however, like a folder with the actual 
> stack as a file somewhere in its inner hierarchy . Using the script 
> above will thus give me a path *inside* the application (... 
> myStackName.app/contents/MacOS/ ) and since such a path is read-only I 
> get a "can't open that file" error.
>
> Any suggestions?
>
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>
>
------------------------------------------------------
Mattias Alveteg
BioGeoChemistry Visit our new web-page!  www2.chemeng.lth.se
Chemical Engineering II
P.O. Box 124
SE 221 00 Lund
phone +46 46 222 36 27
fax: +46  46 14 91 56
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2285 bytes
Desc: not available
Url : http://lists.runrev.com/pipermail/metacard/attachments/20021216/fe98522d/attachment.bin


More information about the metacard mailing list