In RunRev, if an application has to load an external text file which resides in the same directory with it, there's a "default folder" property returns the folder path containing the application, which can be used for location reference. Unfortunately, this property works in different ways between a standalone application and development environment, as described by RunRev dictionary:
When you start up the application directly, the defaultFolder is set to the folder containing the application. If you're using the development environment, this is the folder containing Revolution; if you're using a standalone application, this is the folder containing that standalone. (On OS X systems, the defaultFolder is set to the folder that contains the application bundle.)
Is a value of "the folder containing Revolution" useful for anything? On OS X, who needs the path "/Applications/Revolution Studio/2.9.0-gm-1"?
In the above case, you have to use 2 different paths, one for development and one for the standalone (don't forget to change it and save it before creating a standalone. And don't forget to change it back if the development process has to go on). Obviously this is not a effective workaround. So I had spent some time searching on Web and found the following script:
Code: Select all
function getDefaultFolder
set the itemDelimiter to "/"
get the filename of this stack
return item 1 to -2 of it
end getDefaultFolder
On OS X systems ... The filename of stackproperty reports the location of the application inside the bundle, not the bundle's location ... the filename of the application's main stack might be "/Volumes/Disk/MyApp.app/Contents/MacOS/MyApp".
Is it hard to have a property / function, working in both development and standalone environment, crossplatformly, returning the folder path containing ones own application (NOT Revolution)? Absolutely not. In Macromedia Director, a simple syntax "the moviePath" does the job perfectly. In RunRev, of course you can write a script to solve the problem. The point is, this shouldn't have been a problem.