revGoURL help
Klaus Major
klaus at major-k.de
Thu Nov 6 14:04:24 EST 2003
Hi Roger,
> I've got a file "Gen.html" on my desktop (OS X) along with my RunRev
> application.
> The following script will open "Gen.html" while in Runtime but the
> Standalone does not work:
>
> on mouseUp
> set the itemDelimiter to "/"
> put (item 1 to -2 of the effective fileName of this stack)&"/" into
> myFolderName
> get "file:"&myFolderName&"gen.html"
> revGoURL it --- This works in Runtime but not in standalone
> end mouseUp
>
> I do have Internet Script Libraries checked in the Distribution
> Builder. Can anyone help?
Sounds like a path problem...
On OS X things are a little different than on other platforms ;-)
When in dev-mode "item 1 to -2 of the effective fileName of this stack"
will return
what you exspect...
But when you build a standalone this will return something what you
obviously
don't exspect... (And now to something completely different! :-)
You have to see it to believe it ;-)
Control-Click your standalone and select "Show contents" (or something
like this...)
Then this folder will open and reveal another folder "Contents"...
Another doubleclick will reveal 2 more folders and some files...
Open the folder "MacOS" and you will find a file named "Revolution"...
Now THIS is your original stack you build the standalone from, with the
engine
wrapped around it...
And THIS FOLDER (Appname.app/Contents/MacOS/)!!! is what
"item 1 to -2 of the effective fileName of this stack"
will return in an OS X standalone...
So what can you do?
In this case "the directory" will be the right place :-)
A.k.a "the defaultfolder" or "the folder"
Try this (i do it all the time and it works fine :-D)
on mouseUp
set the itemDelimiter to "/"
if the environment = "development" then
put (item 1 to -2 of the effective fileName of this stack)&"/"
into myFolderName
get "file:"&myFolderName&"gen.html"
else
get "file:gen.html"
##no need to specify a folder, since we ARE in the correct folder
automatically
end if
revGoURL it --- This works in Runtime but not in standalone
end mouseup
See the RR dictionary for "environment"
Hope that helps...
> Thanks, Roger
Regards
Klaus Major
klaus at major-k.de
www.major-k.de
More information about the use-livecode
mailing list