standalone don't find images
Ken Ray
kray at sonsothunder.com
Wed Oct 26 17:21:30 CDT 2005
On 10/26/05 1:11 AM, "Signe Marie Sanne" <Signe.Sanne at roman.uib.no> wrote:
> Ken Ray skrev:
>
>> On 10/25/05 3:53 PM, "J. Landman Gay" <jacque at hyperactivesw.com> wrote:
>>
>>
>>> Reinhold Venzl-Schubert wrote:
>>>
>>>> Hi!
>>>>
>>>> The standalone, that I built, don't find the images in the folder "Media"
>>>>
>>>> In the stackscript I set the directory with
>>>>
>>>> on preopenstack
>>>> get the effective filename of this stack
>>>> set the itemdel to "/"
>>>> delete last item of it
>>>> set the directory to it
>>>> end preopenstack
>>>>
>>>> every image was imported with "Link Only" and "Set Directory" and has
>>>> the Filename "Media/Imagename.jpg"
>>>>
>>>> and the Media-Folder is at the right place, in the same folder as the
>>>> standalone.
>>>>
>>>> What is wrong?
>>>
>>> On OS X, the filename of the main stack in a standalone is the file
>>> inside the app bundle. You should put your media folder inside the
>>> bundle, at: standalone.app/Contents/MacOS/
>>
>>
>> Or, don't bother setting the directory at all - in the standalone, the
>> directory is automatically set to the location of the currently running
>> executable (or OS X bundle) so it automatically is pointing in the right
>> place.
>>
>> (NOTE: It didn't used to be this way on OS X - 'the directory' would be the
>> folder where the *engine* was (in Contents/MacOS/) but that changed in
>> 2.5.1 (I believe).)
>
> (Using MetaCard IDE on latest version of the engine.)
> For an application I used to have the media folder in the same folder as the
> standalone. On Mac 10.3.9 I had trouble finding its path. This script gave
> me the correct path:
>
> set itemDel to "/"
> put item 1 to -2 of (the effective filename of this stack) into hvormappe
>
> if the platform = "macos" then
> set itemdel to "."
> if item 1 of the systemversion > 9 then
> set itemDel to "/"
> if the environment <> "development" then put item 1 to -4 of
> hvormappe into hvormappe
> end if
> end if
Yes, this will work because you're getting the 'filename' of the stack and
then parsing backwards. But now you don't need to do this anymore - all you
need to do is ask for 'the directory' and it will be in the right place. So
if you have a folder called "Media' in the same folder as the standalone,
you need only do this:
put the directory & "/Media" into tMediaFolder
HTH
Ken Ray
Sons of Thunder Software
Web site: http://www.sonsothunder.com/
Email: kray at sonsothunder.com
More information about the metacard
mailing list