opening a web page (archive)

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
herbwords
Posts: 70
Joined: Sat Dec 01, 2007 2:59 am

opening a web page (archive)

Post by herbwords » Sun Jan 04, 2009 8:44 am

Hi,

I've copied a web page (archive) to my desktop and I put it in the same file as the program I've written with Rev. I have a button in the program that I want to open this archive (web page). I have my Airport (wireless) shut off because I want to show how I can open a web page and there may not be web access when I show this. I've tried a few things:

open file "filename.html"
open file "filename"
open file "/home/commonfile/filename"
revGoURL "file:/User/home/Desktop/commonfile/filename"

None of these work! Any suggestions?

Thanks so much,

Patrick

ChristopherBodell
Posts: 52
Joined: Sun Jan 20, 2008 7:06 am

close....

Post by ChristopherBodell » Sun Jan 04, 2009 9:12 am

I think your looking for [open URL "file:filename.html"]

or [open URL "binfile:filename.html"]

It also possible to create a browser instance in an image or within the stacks window by the windowID and naviate with the broswer to that file.

ChristopherBodell
Posts: 52
Joined: Sun Jan 20, 2008 7:06 am

Ooops...

Post by ChristopherBodell » Sun Jan 04, 2009 9:18 am

Sorry, i also kinda misread your thread.....

Rev needs something to open the data with or to put it into maybe jsut a text filed or something,

But if you are just wanting to launch it on the web you want:

launch url "yourFilePathAndName.html" wich will launch it in the appropriate web browser.

Lynn P.
Posts: 79
Joined: Sun Apr 09, 2006 1:09 pm

Re: opening a web page (archive)

Post by Lynn P. » Sun Jan 04, 2009 6:32 pm

herbwords wrote:Hi,

I've copied a web page (archive) to my desktop and I put it in the same file as the program I've written with Rev. I have a button in the program that I want to open this archive (web page). I have my Airport (wireless) shut off because I want to show how I can open a web page and there may not be web access when I show this. I've tried a few things:

open file "filename.html"
open file "filename"
open file "/home/commonfile/filename"
revGoURL "file:/User/home/Desktop/commonfile/filename"

None of these work! Any suggestions?

Thanks so much,

Patrick
Hi Patrick,
Just add a couple of more forward slashes (for a total of 3) to the revGoURL command and if it's a web archive, it should also have ".webarchive" after the filename(even if you have the file extension is hidden by OS X)
revGoURL "file:///User/home/Desktop/commonfile/filename.webarchive"

Obleo
Posts: 174
Joined: Mon Apr 10, 2006 10:35 pm
Location: Chicago
Contact:

Post by Obleo » Sun Jan 04, 2009 11:14 pm

You can also convert the webarchive format to one of these formats : txt, html, rtf, rtfd, doc, docx, wordml, odt, webarchive form shell . And import the converted file into your program. Using the user command textutil to convert the file with the shell function in revolution.

example in rev converting to html

set shellcommand to "/bin/sh"
shell (textutil -convert "~/path 2 file/filename.webarchive" -output "~/Yourfile path/newfile.html" )

or by using: return shell (the textutil command) ,you can return the data into revolution with in a field or variable.

type; man textutil , into the terminal for how to use. also typing in textutil -h , list additional arguments that can be used.

Just another option depending on what your trying to do.

Post Reply

Return to “Talking LiveCode”