Problems with filepaths...

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Problems with filepaths...

Post by Dixie » Wed Sep 02, 2009 11:54 am

Good morning...

I have always set up the location of the default folder with the following handler when my main stack opens... this has always worked in both the development and standalone environments.

Code: Select all

global Alocation

on whereIsApp
   set itemDel to "/"
   put item 1 to -2 of (the fileName of this stack) into Alocation
   set the defaultfolder to Alocation
end whereIsApp
I have now done two things with has upset things. I have installed Mac 10.6 and updated from Rev 3.5 to Rev 4.0. Now using the 'whereIsApp' handler, different results are returned for different environments... for example... in the development environment

'/users/johndixon/Desktop/Dixon'

is returned and placed into Alocation; this is what I expect with the rev file sitting in the folder 'Dixon'. However, if I now build a standalone from the rev file

'/users/johndixon/Desktop/Dixon/Dixon.app/Contents/MacOS'

is returned and placed into Alocation; this is what I did not expect with the standalone sitting in the folder 'Dixon'. To get around this problem I have altered the 'whereIsApp' handler to

Code: Select all

global Alocation

on whereIsApp
   set itemDel to "/"
   if environment() = "development" then put item 1 to -2 of (the fileName of this stack) into Alocation
   if environment() = "standalone application" then put item 1 to -5 of (the fileName of this stack) into Alocation
   set the defaultfolder to Alocation
end whereIsApp
OK, so this work around fixes the problem and I can now get images and QTVR movies to load into their respective containers under the development and standalone environments. However, I have noticed another variable to the environment funtion, 'Browser'. If I build a revlet I don't know what to tell the 'whereIsApp' handler to put into the Alocation global.... adding

Code: Select all

if environment() = "browser" put "http://www.(sub-domain).(domain name).on-rev.com" into Alocation
does not work when running the rev file as a revlet.

But under Rev 3.5, I gave the global Alocation the address where the revlet was sitting on the On-Rev server. eg...

' put "http://www.(sub-domain).(domain name).on-rev.com" into Alocation'

then when I wanted to load a particular image into the revlet, for example, using

'set the filename of image "view" to  Alocation &"/image1.png" '

worked fine. Using Rev 4.0, this does not work. I have asked this question before, but have to ask again... How do I tell objects where the revlet is sitting ?

And finally... anyone getting QuickTime QTVR's to run in revlets?

(an aside for Klaus : My cat is telling me that I should have gone to the conference in Scotland...)

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Wed Sep 02, 2009 2:26 pm

Hi Dixie,

I do not have Snow Leo installed (yet) and also not the time to play around wiht Rev 4 and Revlets.

BUT:
According to the docs, relative pathnames SHOULD work in Revlet, so you SHOULD be able to script:
...
set the filename of img 3 to "image1.png"
...

Don't forget that the web plugin is still in ALPHA status!
So this will (hopefully) work in later versions as exspected!

QuickTime VR:
Do these QTVR files play in the QT Player on 10.6?
I read that Apple actually did not make a good job with QT X, read VR are not (or not good enogh?) supported.

Anyway, this is all "hearsay" you honor :)

But looks like you have a cunning cat, it just wanted to get rid of you for a while, that's why it made this good proposal :D


Best

Klaus

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Post by Dixie » Wed Sep 02, 2009 3:33 pm

Klaus...

Thank you for the reply...

This works, just as you said...
set the filename of image "view1" to "image1.png"

This does not work...
set the filename of image "view1" to "images/image1.png"

So, it looks like it has go to be sitting next to the revlet rather than being in an enclosing folder of its own... Klaus, you mention the 'docs'. Is there some documentation specifically on 'revlets' ? ... and if so, where can I get it ?

QuickTime VR
as far a QuickTime VR is concerned under 10.6, double-clicking on a QTVR file produces a dialog box that says :-

'You need QuickTime Player 7 to open (the name of the file). Do you want to open the movie in QuickTime Player 7?' with 'Cancel' or 'Open in QuickTime Player 7'

be well...

Klaus
Posts: 14198
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Wed Sep 02, 2009 5:45 pm

Hi Dixie,

sorry, I did not mean "docs" but someone on the list posted this.
The docs are still not ready for Revlets.

But QTVR not playing out of the box on 10.6 is a BIG shame :/


Best

Klaus

Post Reply