standalone naming
Sarah Reichelt
sarahr at genesearch.com.au
Thu Jan 8 23:18:25 EST 2004
> If I refer to an image in a subfolder at the same level as the app
> then in OSX how are the images referenced from with in the bundle? It
> seems I might get in trouble then renaming the OSX bundle.
Suppose you have a .rev stack file and in it's folder, you have a
sub-folder called "Images" containing "image.png". To load that image
while in the IDE, you could use this script:
put the fileName of this stack into tFile
set the itemDel to "/"
put "Images/image.png" into last item of tFile
set the fileName of image 1 to tFile
When an OS X bundle is built, what looks like an application file is
actually a special sort of folder. Right-click / control-click on the
application icon and choose "Show Package Contents" from the contextual
menu.
You will see a single folder called "Contents". Open that and you will
see two more folders plus three other files. Open the "MacOS" folder
and you will find a file called "Revolution". This is your actual
application and the file containing your stacks. If you copy your
Images folder into the MacOS folder in the bundle, it will be
accessible using the exact same script as when in the IDE. Plus, your
images and any other external files you might want to access, are all
hidden neatly inside the bundle, allowing drag & drop installation.
None of this is affected by changing the name of the actual bundle.
> referencing things is a bit complicated.
It is a bit more trouble than hard-wiring file paths, but it pays off
in the end as it allows a lot more code-reuse and flexibility.
>
> I might just stick to renaming the OS9 version so it is
> distinguishable from the OSX version and leave the OSX version alone.
That's fine, so long as you don't want to hide anything inside the
bundle.
> I finally got the windows autorun.inf version running
Well done.
Cheers,
Sarah
More information about the use-livecode
mailing list