QT and standalones -- incompatible?

Peter Reid preid at reidit.co.uk
Fri May 5 19:26:56 EDT 2006


Hi Robert

Are you trying to do this on a Mac running OS X?  If so the problem 
could be to do with the way OS X application packages work - an 
application package is really a folder. If you get the current folder 
relative to the stack within the development environment and then try 
the same when running as a standalone, you'll find a significant 
difference!

For example, I have a small stack called SoundTest.rev that looks for 
a folder called Sounds at the same level in the filing system, i.e. 
in the same parent folder:

   Sounds
   SoundTest.rev

In the development environment I can locate the content of the Sounds 
folder as follows:

   put the filename of this stack into gSoundPath
   set itemDelimiter to "/"
   put "Sounds/" into the last item of gSoundsPath

My global variable gSoundsPath now has the path to the contents of my 
Sounds folder.

However, if this were saved as a standalone application, then I'd 
find the following folder structure:

   Sounds (my original folder)
   SoundTest.app  (my standalone program, which is an OS X 'package')
     Contents
       MacOS
         SoundTest  (the real standalone program!)

When I get the 'filename' of SoundTest this time, I get the path down 
to SoundTest inside the MacOS folder (which is inside the Contents 
folder, which is inside the SountTest.app package/folder).

The solution is to change the script above to cater for running in 
both the development environment and as a standalone application as 
follows:

   put the filename of this stack into gSoundPath
   set itemDelimiter to "/"
   if the environment is "development" then
       put "Sounds/" into the last item of gSoundsPath
   else
       put "Sounds/" into item -4 to -1 of gSoundsPath
   end if

Now my global variable gSoundsPath has the path to the contents of my 
Sounds folder irrespective of wether my stack is running in the 
development environment or as a standalone application!

I hope the above helps.

Cheers

Peter


>I can not develop a standalone on one computer that will play a QT movie
>(Movie trial.mov) on another computer. I have determined the absolute file
>path to the player (with QT file) using
>
>put the defaultFolder & "/" & "Movie trial.mov" into movieName
>set the fileName of player "Play" to movieName
>
>The file path is correct on any computer, but the movie won't play. It plays
>just fine using the stack file, but not with the corresponding standalone.
>The "Movie trial.mov" is included in the standalone package/folder with the
>application.
>
>
>
>--
>Robert E. Ball, PhD
>Distinguished Professor, Emeritus
>Department of Aeronautics and Astronautics
>Naval Postgraduate School
>Monterey, California

-- 
Peter Reid
Reid-IT Limited, Loughborough, Leics., UK
Tel: +44 (0)1509 268843 Fax: +44 (0)8700 527576
E-mail: preid at reidit.co.uk
Web: http://www.reidit.co.uk



More information about the use-livecode mailing list