Standalone problem

J. Landman Gay jacque at
Tue Mar 8 22:53:14 EST 2011

On 3/8/11 9:11 PM, edward cawley wrote:
> I modified Francis code as follows:
>   put the platform into  GVHoldPlatform
>     if GVHoldPlatform = "MacOS" then
>        put "misippfiles/" into GVStackPath -- No leading drive on the  Mac.
>     end if
>     if GVHoldPlatform = "Win32" then
>        --     System 7 patch to ensure using the Systems Disk for  "StackPath" on PC's
>        put item 1 of specialfolderpath("system")&   "/misippfiles/"into  GVStackPath-- Get Stack Path with Disk ID.
>        replace "WINDOWS/" with empty in  GVStackPath       -- Remove Windows Folder Name.
>     end if

You've got a mix of relative and absolute paths there. For MacOS, it's 
relative. When your app starts up, assuming you haven't changed the 
defaultfolder, the place it is going to look for files is in the same 
folder with the standalone. Your path points to a folder called 
"missippfiles" inside the standalone folder.

For the Windows segment, the script gets an absolute path to the system 
folder at the root of the drive, and looks for your "missippfiles" 
folder next to that. I'm betting you aren't storing images there on Windows.

You can use the same folder path for both Mac and Windows. Your image 
files are always going to be relative to where your standalone is no 
matter which drive holds it, so you don't care about the drive letter. 
It isn't necessary to check for platform, just use this for all 
operating systems:

   put "misippfiles/" into GVStackPath

Put your "misippfiles" folder right next to your standalone, inside the 
same enclosing folder.

Be aware that if any of your scripts change the defaultfolder, the paths 
won't work any more if you are calculating them on the fly. It would be 
a good idea to store GVStackPath in a variable early after startup so 
you can use it later, since it isn't going to change. If the scripts 
never change the defaultfolder, then you probably don't even need to do 

Jacqueline Landman Gay         |     jacque at
HyperActive Software           |

More information about the use-livecode mailing list