Loading local files into revBrowser (Mac)
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Loading local files into revBrowser (Mac)
Hello,
I'm having troubles with loading local files and Mac.
I've got the whole stackpath() thing down and it works well with Windows, displaying the html in the browserimage.
But what's the trick for getting Mac's to display local html?
TIA (Mark)
Simon
I'm having troubles with loading local files and Mac.
I've got the whole stackpath() thing down and it works well with Windows, displaying the html in the browserimage.
But what's the trick for getting Mac's to display local html?
TIA (Mark)
Simon
Haha :oops: maybe I should pass on your question to someone else, Simon? (assuming that you mean me)....
Anyway, it looks like something is wrong with the path to the html file, perhaps stackpath() returns an incorrect value, or there is a problem with the browser external on the Mac.
Are you running the Mac version as a standalone? Did you make sure to include the browser external?
Is the HTML file in the same location relative to the stack, on both Mac and PC?
If the answer to both questions is yes, could you post your stackpath() function here?
Best,
Mark
Anyway, it looks like something is wrong with the path to the html file, perhaps stackpath() returns an incorrect value, or there is a problem with the browser external on the Mac.
Are you running the Mac version as a standalone? Did you make sure to include the browser external?
Is the HTML file in the same location relative to the stack, on both Mac and PC?
If the answer to both questions is yes, could you post your stackpath() function here?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi Mark,
Yes on Mac standalone.
Yes on browser external (same one used by Mac and PC?)
Yes on relative position.
I've been able to access other files using this script for both PC and Mac, just can't load local html into revBrowser on Mac. But I can load external domains.
Thanks again,
Simon
Yes on Mac standalone.
Yes on browser external (same one used by Mac and PC?)
Yes on relative position.
Code: Select all
function stackPath
put the filename of this stack into tPath
set the itemdel to "/"
if "Mac" is in platform() then
get offset(".app/Contents/MacOS/", tPath)
if it > 0 then
delete char it to len(tPath) of tPath
end if
end if
delete last item of tPath
return tPath &"/"
end stackPath
Thanks again,
Simon
Hi Simon,
I am not sure what you want to achieve with your function. There is no folder with the name/path returned by your function.
I assume you have an html file next to your standalone and let's assume that your standalone is called "standalone". The standalone is actually a folder. This folder is called "standalone.app".
To get the parent folder of your standalone, all you need to do is:
Does this work for you?
Best,
Mark
I am not sure what you want to achieve with your function. There is no folder with the name/path returned by your function.
I assume you have an html file next to your standalone and let's assume that your standalone is called "standalone". The standalone is actually a folder. This folder is called "standalone.app".
To get the parent folder of your standalone, all you need to do is:
Code: Select all
put the effective filename of me into myPath
set the itemDel to slash
if the platform is "MacOS" then
return (item 1 to -5 of myPath) & slash
else return (item 1 to -2 of myPath) & slash
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi Mark,
The part I left out of the stackPath()
Your code worked the same, works on PC not on Mac.
I really don't think it's a path problem as I have used my code in a bunch of apps that have no trouble finding other types of files.
I've reduced the html to just have 1 jpg in it, nothing fancy, but Mac will only show a white screen.
Regards,
Simon
The part I left out of the stackPath()
Code: Select all
put (stackPath() & "intro.html") into appPath
I really don't think it's a path problem as I have used my code in a bunch of apps that have no trouble finding other types of files.
I've reduced the html to just have 1 jpg in it, nothing fancy, but Mac will only show a white screen.
Regards,
Simon
Simon,
The white screen, is that just your card?
Do you have a bundle called revBrowser.bundle in the externals folder of your standalone?
Best,
Mark
The white screen, is that just your card?
Do you have a bundle called revBrowser.bundle in the externals folder of your standalone?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi Simon,
I'd check that your html file exists, just to be sure:
Here, I assume that your file path starts with a slash. If not, you'll need to add one.
It is also possible that the jpg file specified in the html code is not available. Have you checked this?
Best,
Mark
I'd check that your html file exists, just to be sure:
Code: Select all
if there is a file <your file> then
revBrowserSet gBrowserID,"url","file://" & <your file>
else
beep
answer "No such file!" with "Okay"
end if
It is also possible that the jpg file specified in the html code is not available. Have you checked this?
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi Simon,
Can you turn on error reporting in the standalone settings and build a new standalone? Which version of Mac OS X are you using?
I have created a stack with the same setup, which works fine on Mac and Win.
I have put the stack here:
http://economy-x-talk.com/test.zip
This will stay available during the next few days.
Best,
Mark
Can you turn on error reporting in the standalone settings and build a new standalone? Which version of Mac OS X are you using?
I have created a stack with the same setup, which works fine on Mac and Win.
I have put the stack here:
http://economy-x-talk.com/test.zip
This will stay available during the next few days.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Simon...
You have probably ran into a bug. I did a test on Mac OS X 10.3.9.
http://quality.runrev.com/qacenter/show_bug.cgi?id=6063
Best,
Mark
You have probably ran into a bug. I did a test on Mac OS X 10.3.9.
http://quality.runrev.com/qacenter/show_bug.cgi?id=6063
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Hi Mark,
Thanks and best regards
I also wish to load local webpages into the revBrowser. Could you please put your test stack on your website again?I have created a stack with the same setup, which works fine on Mac and Win.
I have put the stack here:
http://economy-x-talk.com/test.zip
This will stay available during the next few days.
Thanks and best regards
Alex
Nice to meet all of you.
Nice to meet all of you.