JScript, as well as VBScript, can be used in the Windows Scripting
Environment. You can access various (if not all?) Windows objects.
HomeSite (and Studio and JRun) allow you to run scripts within the
application to perform various tasks. It's a way to extend the
functionality of HomeSite/Studio.
Normally, to run a script you would create a custom button on a toolbar, but
you can also run a script, if it is the open/active document, by pressing
shift-control-Q.
Take the code below, paste it into a document, save it with a .js extension,
then press shift-control-Q (you may need to change the path of the file
you're saving before executing)
function Main() {
var sURL;
var sContents;
var doc;
var app;
app = Application;
doc = app.ActiveDocument;
sURL = "http://www.howardowens.com/";
with (app){
sContents = GetURL(sURL);
// Storing HTML code of the URL in sContents
}
var fs = new ActiveXObject("Scripting.FileSystemObject");
var TestFile = fs.CreateTextFile("C:\\CFusionMX\\wwwroot\\foundpage.html",
true);
TestFile.WriteLine(sContents);
}
/-- end code with curly brace above.
Now go open the document you just saved. It's the source code for the page
you specified in the script.
Here's more info for you:
http://www.webreference.com/js/column48/customize.html
http://scripts.hsguide.com/scripts.php3
H.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Owens
Internet Operations Coordinator
Ventura County Star / E.W. Scripps Co.
www.venturacountystar.com
[EMAIL PROTECTED]
AIM: GoCatGo1956
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> -----Original Message-----
> From: DURETTE, STEVEN J (AIT) [SMTP:[EMAIL PROTECTED]
> Sent: Friday, October 10, 2003 11:44 AM
> To: CF-Talk
> Subject: RE: Another HomeSite+ Scripting Question
>
> I was under the impression that JSCRIPT was client side only and therefore
> cannot access datasources.
>
>
> Steve
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

