Metacard menu?
Ken Ray
kray at sonsothunder.com
Sat Nov 9 16:20:00 EST 2002
Shari,
Under OS X in a standalone, if you ask for "the filename of this stack", you
will get a path that points all the way into the Contents folder of the
bundle to the MetaCard engine. For example, if I have a standalone called
"Test" that is on my desktop, asking for the fileName returns:
/Users/kenray/Desktop/Test.app/Contents/MacOS/MetaCardCarbonMach-O
To get the "folder" of the bundle itself, I use a variation of Richard
Gaskin's AppPath() function:
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
Calling AppPath on my standalone returns:
/Users/kenray/Desktop/Test.app/
which is the path to the bundle. OK, now you need to get at the Info.pList
file. This is inside the "Contents" folder of the bundle, so you could say:
put AppPath & "Contents/Info.plist" into pListPath
What you're looking for to change is a line reading
"<string>MetaCard</string>" which follows the line with
"<key>CFBundleName</key>" in it.
As far as I can tell, there is only one line in the Info.pList file that has
"<string>MetaCard</string>" in it, so you could do:
put URL ("file:" & pListPath) into pListData
replace "<string>MetaCard</string>" with "<string>Shari's App</string>" in
pListData
put pListData into URL ("file:" & pListPath)
That *should* work, but you'll have to verify it to make sure.
Hope this helps,
Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/
----- Original Message -----
From: "Shari" <gypsyware at earthlink.net>
To: <metacard at lists.runrev.com>
Sent: Saturday, November 09, 2002 9:26 AM
Subject: Re: Metacard menu?
> >I haven't tried it, but it seems to me that an OS X application
> >bundle should just look like a regular folder in OS 9. If that's
> >true, then it seems like you could just open the appropriate
> >subfolder and edit the plist in SimpleText.
>
> Can anybody point me to the name of the subfolder, the name of the
> file, and the contents of the file so that I don't replace the wrong
> text?
>
> I'm going into this blind, not having any way to see it for myself.
>
> --
> --Shareware Games for the Mac--
> http://www.gypsyware.com
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard
>
More information about the metacard
mailing list