Re: Open webpage [message #72210] |
Mon, 23 August 2010 07:30  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 8/23/10 4:50 am, Wox wrote:
> Hi All,
>
> I used to open a webpage from within IDL using online_help like this:
>
> file='link.html'
> URL='http://www.dfanning.com'
> openw,lun,file,/get_lun
> printf,lun,'<HTML><HEAD><META HTTP-EQUIV="refresh" CONTENT="0;
> URL='+URL+'"></HEAD>If this page does not refresh, click<A
> HREF="'+URL+'">here</A>.</HTML>'
> free_lun,lun
> online_help,book=file
>
> This doesn't seem to work anymore in IDL8.0 Any ideas for a
> cross-platform way of opening a webpage in a webbrowser from within
> IDL?
Try MG_OPEN_URL:
http://lib.idldev.com/net/mg_open_url.pro
Should work nicely on Mac and Windows; on Linux, you will be asked on
the first use to locate your preferred browser, after that it should
work automatically.
Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
|
|
|
Re: Open webpage [message #72303 is a reply to message #72210] |
Tue, 24 August 2010 02:09  |
Wout De Nolf
Messages: 194 Registered: October 2008
|
Senior Member |
|
|
On Mon, 23 Aug 2010 08:30:54 -0600, Michael Galloy <mgalloy@gmail.com>
wrote:
> On 8/23/10 4:50 am, Wox wrote:
>> Hi All,
>>
>> I used to open a webpage from within IDL using online_help like this:
>>
>> file='link.html'
>> URL='http://www.dfanning.com'
>> openw,lun,file,/get_lun
>> printf,lun,'<HTML><HEAD><META HTTP-EQUIV="refresh" CONTENT="0;
>> URL='+URL+'"></HEAD>If this page does not refresh, click<A
>> HREF="'+URL+'">here</A>.</HTML>'
>> free_lun,lun
>> online_help,book=file
>>
>> This doesn't seem to work anymore in IDL8.0 Any ideas for a
>> cross-platform way of opening a webpage in a webbrowser from within
>> IDL?
>
> Try MG_OPEN_URL:
>
> http://lib.idldev.com/net/mg_open_url.pro
>
> Should work nicely on Mac and Windows; on Linux, you will be asked on
> the first use to locate your preferred browser, after that it should
> work automatically.
>
> Mike
Thanks for the tip. However, I figured out that it works when you do:
online_help,book=file_search(file,/full)
I didn't test on MAC but this seems to be a platform independent way
of opening webpages.
|
|
|