There is such a thing as ActiveScript in Studio so that you can build little
code things to do whatever you want. It's not hugely functional but you can
pull in COM objects to do whatever you want.
I wrote some ActiveScript to put documentation into pages that didn't have
any. Click a button, fill in a few dialogue boxes to put in specific
information then outputted as a CF comment at the end of the file. This was
then read by a browser I created. A whole documentation system. Very easy
(when you know how!).
Have a look in the Help Files in Studio at "Scripting the Visual Tools
Object Model" and then have a go. It's a bit limited and the documentation
isn't wondefully clear, but is useful when you get used to it.
Paul
PS If you want an example, here it is! Set it up as a button on a custom
toolbar, and then (it asks if you want to use a script) point the button at
the script. I hope it works!
----------------- code example -----------------
function Main()
var app = Application; //create application object variable
// if any text is selected, then don't continue
message = "This is a pre-alpha version of cfdoc vtom.\n";
message = message + "This will add in cfdoc documentation at the end of
the file.\n";
message = message + "If you do not want this, press cancel. Otherwise,
enjoy!";
// ask if you want to continue
check = app.MessageBox(message,"",1);
if (check == 1) {
// set up the start and end of cfdoc variables that we will be using
start_cfdoc = "\n\n<!---\n=cfdoc\n";
end_cfdoc = "\n=endcfdoc\n --->\n";
// get head_text user input
default_head_text = "Insert Heading";
head_text = app.InputBox("Please insert a cfdoc heading:","Input
Heading",default_head_text);
head = "\n=head '" + head_text + "'\n";
// if head_text is nothing or is "Heading" (default) then end
if ( head_text == default_head_text ) {
head_text = "";
app.MessageBox("You have not entered a heading. An empty header
will be inserted.","",48);
}
// add in subheadings
no_more_cfdoc = "continue";
body_text = "";
sub_head = "\n\n=subhead '";
end_sub_head = "'\n";
i = 0;
i_max = 10;
next = "";
app.MessageBox("This dialogue will allow you to add subheading and
text for up to " + i_max + " subheadings.","",48);
for (i = 0; i < i_max; i++) {
if (i != 0) {
next = "";
}
sub_head_text = app.InputBox("Please add " + next +
"sub-heading.", "Please add " + next + "sub-heading.", "");
next_sub_head = sub_head + sub_head_text + end_sub_head;
next_sub_head_body = app.InputBox("Please input the text for the
subheading","Please input the text for the subheading","");
body_text = body_text + next_sub_head + next_sub_head_body;
// see if they want to add more documentation
add_more_documentation = app.MessageBox("Add more cfdoc?","Add
more cfdoc?",4);
if (add_more_documentation == 7 ) {
i = i_max;
}
}
// while (no_more_cfdoc != "yes");
// retrieve text of file
file_text = app.ActiveDocument.Text;
// set up cfdoc documentation
cfdoc_documentation = start_cfdoc + head + body_text + end_cfdoc;
// output entire text
app.ActiveDocument.Text = file_text + cfdoc_documentation;
err_msg = "";
}
// wait 1/2 second and then output thank you message
app.Wait(500);
check = app.MessageBox("Thank you for your interest in cfdoc
documentation system.\n For more information, contact:\n\nPaul
Johnston\n\[EMAIL PROTECTED]","",1);
// get rid of the object reference
app = "";
}
----------------- code example -----------------
-----Original Message-----
From: Clint Tredway [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 08, 2001 10:16 PM
To: CF-Talk
Subject: RE: Does Studio have Built-in Scripting?
I use Note Tab because of it's internal scripting language or I use my
DevAssistant. The DevAssistant is CF based and can build forms,stored
procedures, and more.
-----Original Message-----
From: Greg Wolfinger [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 08, 2001 3:15 PM
To: CF-Talk
Subject: Re: Does Studio have Built-in Scripting?
> I just wish that Studio had an "on the fly" MACROS capability to capture
> and replay keystrokes or mouse clicks -- man would that save a big bunch
of
> time (and brain cells) when doing detailed, redundant, repetitive work.
I ususally end up writing small vb aps that use the windows api functions to
create macros. Sure, it takes a little bit more time than if there were
macros, but you have more flexibility and much more power that way. Visual
Basic isn't a difficult language to learn either. Go down to your local
software store and pick up Microsoft's Learn Visual Basic 6 for about $80.00
and you'll be set.
--Greg
----- Original Message -----
From: "Dru Whitledge" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, January 08, 2001 3:21 PM
Subject: Re: Does Studio have Built-in Scripting?
> I just wish that Studio had an "on the fly" MACROS capability to capture
> and replay keystrokes or mouse clicks -- man would that save a big bunch
of
> time (and brain cells) when doing detailed, redundant, repetitive work.
>
> Dru
> 303 666-7665
>
> At 14:00 1/8/2001 -0600, you wrote:
> >
> >Is there a way to set up scripts to run and do something within studio.
> >Something like writing the Last Modified Date to a comment field when the
> >file is saved? I know other programs have some of their own built-in
> >scripting. Does Studio, and if so, where do I find it?
> >
> >Thanks.
> >
> >Vance Duke
> >Cold Fusion Application Developer
> >i2 Technologies
> >(469) 357-4729
> >
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists