Relative folder paths

Bill Vlahos bvlahos at mac.com
Wed May 30 23:52:01 EDT 2007


Bob,

Thanks for the info. This sounds like a good solution if the problem  
is complicated.

Fortunately, in my case there are only  a couple of locations I need  
to find and they are all relative to the standalone. What I did was  
to simply put the defaultFolder into and invisible field on openStack  
so it would be saved somewhere. I then just keep changing the  
defaultFolder when needed because I know where the files are supposed  
to be.

Bill

On May 29, 2007, at 1:18 PM, Bob Earp wrote:

> Bill,We needed to use relative paths for audio and video clips,  
> plus graphics in our CBT engine some time ago, and came upon the  
> same problems as you.  Particularly as sometimes the projects were  
> distributed via CD or DVD and we had no control over what drive  
> letter/name was being used.  I'm not sure if our solution will help  
> you but I'm totally gob smacked to be able to offer something to  
> this group instead of continuing to be a leach on the Rev society !! 
> We overcame it by calling an initPaths handler (see below) called  
> from an openStack handler.  We then wrote our own video and audio  
> handlers that refer to those globals.  The graphics are handled by  
> making sure we refer to just the file name (not the path) in the  
> Name property of the Image control, which is a bit weird as   
> sometimes it is displayed in the Property Inspector including the  
> current path and file name.You'll note that we had to deal with the  
> paths differently for MacOS vs Windoze.  If you'd like the audio  
> and video handlers (which include the ability to stop the media via  
> an ESC key press), I'd be happy to upload them.  They're very  
> small. I seem to remember that Rev was saying that relative paths  
> were a new feature, but I haven't looked into it recently as what  
> we did solved our problem.HTH, Bob...on InitPaths  -- get and save  
> the project path    if the platform = "MacOS" then -- this is  
> required for Mac platforms only due to differences in file path  
> reporting    set the itemDelimiter to "/"    put the effective  
> fileName of this stack into gProjectPath    delete the last item of  
> gProjectPath  else    set the itemDelimiter to "/"    put item 1 to  
> -2 of the effective filename of this stack into gProjectPath  end  
> if      -- setup the audio folder path  put gProjectPath & "/Audio"  
> into gAudioPath    -- set up the video folder path  put  
> gProjectPath & "/Video" into gVideoPath    -- set up the graphics  
> path for image controls  set the defaultFolder to gProjectPath & "/ 
> Graphics/"  end InitPaths~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Date: Fri,  
> 25 May 2007 17:10:29 -0700From: Bill Vlahos  
> <bvlahos at mac.com>Subject: Relative folder pathsTo: How to use  
> Revolution <use-revolution at lists.runrev.com>Message- 
> ID:<B1E7BAB9-0112-1000-B470-63B572F54FB3- 
> Webmail-10006 at mac.com>Content-Type: text/plain; charset=ISO-8859-1I  
> can't seem to refer to folders via relative paths.Lets say I have a  
> folder containing a standalone, Data folder, and Preference folder  
> all at the same level. The defaultFolder would be the folder at the  
> level of the standalone.If I change the defaultFolder to  
> "DataFileFolder" I can then just "put the files into vFilesList" to  
> get a listing of the files. However, this resets the defaultFolder  
> value so I can't get to things in the Preference folder.How would I  
> get a listing of files in the defaultFolder/DataFileFolder? 
> Thanks,Bill Vlahos~~~~~~~~~~~~~~~~~~~~~~~~Robert J. Earp -  
> PresidentAshford Technologies Inc.#8 5965 205A Street,  
> LangleyBritish Columbia.  V3A 8C4t: +1 604 539 1662f: +1 604 541 1686
> _________________________________________________________________
> Explore the seven wonders of the world
> http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en- 
> US&form=QBRE_______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list