PDA

View Full Version : hyperlink in Lscript plug-in


François Tarlie
02-11-2005, 04:48 AM
:confused: I want, when I click on a button link to webpage, how can I do that ?

faulknermano
02-11-2005, 06:08 AM
i have not tried it, but i think you should read the version 2.7 release notes:

LScript v2.7 provides hooks in its functionality for a rather interesting new feature: URL file
referencing. Currently, this functionality will be employed by LScript in cases where external
script components are referenced (Object Agents, include files, etc.).

In order to activate this functionality, you must first acquire the shared-library build for
your platform of the W3C code distribution called libwww.

Once you have these files (numbering approximately 26 *.dll files for the Windows distribution),
they must be placed in the "w3c" subdirectory of the LScripts/ installation directory. For
example, if you have installed LightWave in "C:\LightWave", then the libwww files must be
placed in "C:\LightWave\LScripts\W3C" in order to activate this dormant LScript functionality.

Once the W3C files are correctly located and loaded into LScript, your script can specify URL
references for script components instead of local filenames. For instance, a script could then
reference an Object Agent include file published on an HTTP server as:

...
@include "http://www.myobjectagents.com/cooloa.inc"
...

Further, inside the referenced include file, the Object Agent declaration line would then utilize
a URL instead of a file path to bring down the actual Object Agent binary file from the HTTP
server:

...
use "http://www.myobjectagents.com/cooloa.oal" as class CoolOA;
...

As with Web pages in your favorite brower, files retrieved from an HTTP server in this fashion are
cached locally on your machine (in the same folder as the W3C directory). Each time the files are
referenced by URL, the local file dates are checked with the HTTP server, and files with newer dates
are refreshed locally. In this way, the component publisher has only to update the files on their
HTTP server, and all people using them will receive the updates automatically the next time any
script referencing them is executed.


URL file referencing is really more of an experimental feature
because cross-platform usage is not necessarily guaranteed (it
has only been successfully tested under the Windows operation system).


i have not tried this myself so i can not offer any advice.

François Tarlie
02-22-2005, 05:51 AM
I couldn't find the right file for the libwww. It's suppose to be DLL file right ? well all I can find is pack of code source ... Does somebody which file I need exactly ?

#lwrs_web
02-22-2005, 06:20 AM
libwww doesn't help here.

check this script

François Tarlie
02-23-2005, 06:29 AM
oki cool but could you explain what is the shell.exe where can I find it ? I don't really understand why we need this file ?

#lwrs_web
02-23-2005, 07:38 AM
OK forget the shellex.exe (it passes the command line parameter to ShellExecute)

It's easier:
spawn(string(getenv("comspec"), " /c start ", sURL));

François Tarlie
03-10-2005, 04:34 AM
:mad:

ok I can't make this thing work !!!! I must be stupid.
could you tell me how I can put a button on my script that link directly to my website for exemple when we click on it.
please

aurora
03-19-2005, 09:43 AM
This is a seriously cool feature but if its not cross platform and if the user has to dl a ton (26!) of dll's just to get this to work. Hmm, well I personally am going to leave it of my scripts for now. Bumm, I hope they keep experimenting. This would be a nice feature to have in LScripts. Just think scripts that could go out and check for auto-updates!!!!!

François Tarlie
03-19-2005, 11:41 AM
could you please explain me the different args in this function

spawn(string(getenv("comspec"), " /c start ", sURL));

string ?
getenv ?
comspec ?
/c ?
start ?

almost everything :p

thx

NanoGator
03-24-2005, 12:26 PM
Arg. Compsec rings a bell and I can't remember why!

François Tarlie
03-24-2005, 01:46 PM
that doesn't help me at all ... is anyone are able to explain all this thing to me .. please

NanoGator
03-24-2005, 01:57 PM
could you please explain me the different args in this function

spawn(string(getenv("comspec"), " /c start ", sURL));

string ?
getenv ?
comspec ?
/c ?
start ?

almost everything :p

thx

Ok, I think I've figured this out:

string- Takes whatever it recieves from 'getenv("comspec")' and makes sure it's a string, as opposed to an integer or something.

compsec- It's asking the OS what it's command interpreter is. It'll say 'Command.com', for example.

getenv- This is asking for an environment variable. I'm not sure, but I think it's actually asking Windows what that variable returns.

/c- That's actually being sent to compsec to run. I'm not sure precisely what it means, but I think it has to do with opening a window.

start- This is another command for comspec that tells it to start a new process.

Basically, it's a command-line way of running a shortcut that says "open this URL in whatever Windows' browser is."

NanoGator
03-29-2005, 06:53 PM
Neato, it works!

François Tarlie
03-30-2005, 01:39 AM
so you just have to replace the sURL by the actual website url or field the sURL variable a the beginning of the script ... and voila !!!! it works ???