How do you most easily write, edit, debug, and run .wsf files for WSH (not
other hosts)?
thanks,
Chazz
??? I have no problem debugging WSF scripts (using the src='...' on the
script element is irrelevant.
Of course I haven't used the old downloadable script debugger in years...
VStudio will debug script hosted via WSH.
Do you have any Office 2000 or Office XP apps?
To install the optional Microsoft Script Editor
--> Add/Remove programs, <your Office 2000/XP app>
--> change, add or remove features
then look under Office Tools -> HTML Source Editing -> Web Scripting.
MSE is actually a stripped down version of InterDev (even the same program
icon) and is a quite nice script debugger. I actually prefer it for script
since it loads faster thean the VStudio script debuggers.
With the Office XP version of MSE (MSE7.EXE), syntax coloring and
IntelliSense both work great right out of the box. It already knows about
js/vbs/wsf script extensions (I had to add the wsc extension manually).
You can also pass a file name via the command line when you start MSE7.EXE
and it will open the script in the editor (the mse.exe Office 2000 version
wouldn't accept a file name via the command line).
You can't start the debugger for WSH hosted script files via the Debug /
Start menu. But there is a 'View/Open With...' menu option. The Open With
dialog already had wscript.exe as an option.
You can add more 'View/Open With...' choices for:
wscript.exe //d --> which I named wscript (debug enabled)
wscript.exe //x --> which I named wscript (start in debugger)
and cscript.exe versions as well. The dialog complains (only a bit,
probably because of the switches) but lets you add them anyway.
What's really nice is that when you use these, you get a choice of debugging
in the current instance of MSE (where you're editing) or a new instance of
MSE or in any other available script debugger you may also have installed,
such as the various versions of VStudio.
--
Michael Harris
Microsoft.MVP.Scripting
Microsoft® Windows®2000 Scripting Guide
http://www.microsoft.com/technet/scriptcenter/scrguide/sagsas_overview.asp
TechNet Script Center Sample Scripts
http://www.microsoft.com/technet/scriptcenter/default.asp
Download in HTML Help format (searchable)
http://www.microsoft.com/downloads/release.asp?ReleaseID=38942
WSH 5.6 documentation download
http://www.microsoft.com/downloads/details.aspx?FamilyId=01592C48-207D-4BE1-8A76-1C4099D7BBB9&displaylang=en
=========
It never passed the grade !
Office 4.03 and alias.
"Chazz" <ch...@chucksphar.com> wrote in message
news:KbzZb.24538$aH3.7...@bgtnsc04-news.ops.worldnet.att.net...
I haven't tried Michael's suggestion, but will tomorrow.
I have been using PrimalScript from Sapien Technologies as an
editing/debugging tool. What I like most about this is the fact that the
editor looks after all of the details of the XML coding in the .WSF file,
allowing me to concentrate on the actual scripting. And, as a scripting
editor, it has the desired features like highlighting and intellisense.
The debugging facilities are somewhat minimal, but that suits me fine in
most cases. I generally sprinkle wscript.echo's around liberally when I run
into a problem, as this writes the output to a scrollable child window in
the editor. Even if a lot of "debug" output goes there I can find what I am
looking for with an editor search.
Most of my scripts run under wscript, so if I forget to remove the debugging
wscript.echo's, then I am rudely reminded when I try to run under wscript.
/Al
Just an FYI...
PrimalScript itself does not include or install a script debugger. It
simply knows how to launch script with the right host swithces (//x //d) to
enable debugging. The actual debuggers are installed via MS products (I
don't know of any 3rd party, non-MS script debuggers). When prompted to
debug, I have 3 debugger choices - MSE, VS 6, and VS.Net).
--
Michael Harris
Microsoft.MVP.Scripting
I understand that, on its own, PS is not a *real* debugging tool. But it is
a heck of a lot better than editing script in notepad and then running it in
the normal manner. Nonetheless, one need not have a "debugger" to debug,
just the ability to find and identify bugs, then do something about it.
/Al
Chazz
"Michael Harris (MVP)" <mikhar at mvps dot org> wrote in message
news:OhbNbWK#DHA....@TK2MSFTNGP11.phx.gbl...
What version of MSE (Office 2000 or Office XP)?
The Office 2000 version of MSE (MSE.EXE) needs some registry tweaks (and
*.wsf with real <script> elements or *.js or *.vbs with commented <script>
elements) to be useful as a standalone script editor.
thanks,
Chazz
"Michael Harris (MVP)" <mikhar at mvps dot org> wrote in message
news:#2rbDhz#DHA...@tk2msftngp13.phx.gbl...
I don't get any odd behavior opening *.wsf files using mse7.exe's normal
file open dialog. They open for editing and can be executed with the
'view/open with' wscript.exe same as any other script type...
--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--
Michael Harris
Microsoft.MVP.Scripting
Sammamish WA US
Are there some tweaks I need to make for full support to work?
Thanks,
Lee
[to email please remove the dots from uop]
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
A debugger/syntax highlighter is just a pair of
white cotton gloves.
"Lee Gray" <lee....@u.o.p.com> wrote in message
news:%239Jmz0h...@TK2MSFTNGP12.phx.gbl...