Advanced Search
Mail us
Home    Manuel    Links    Faq    Submit a tcl/tk Reference    Contact Us

    Some examples tcl/tk codes     Man of Bwidget     Man of blt     mkwidget screenshots     TkOgl     Video Demo real.

  How to Run Scripts from Windows
 How do I run a script? 

There are three approaches to starting scripts in Tcl: source, shortcuts, and file associations. 

The most obvious way is to launch the Wish application and use "source". This is the best way to debug scripts. 

The second alternative is to create a Program Manager icon (Windows 3.x or NT 3.x) or a shortcut (Windows 95). The binary
release uses this technique for the widget tour icon. The command line for the icon should be something like: 

c:	clinwish83.exe c:myscript.tcl

The third way to launch a Tcl script is to create a file type association for the extension ".tcl" (or ".tk"). Using the File Manager
(or My Computer in Windows 95), create a new file type for .tcl, and add an "open" action. The command for the action should be
something like: 

"c:Program Files	clinwish83.exe" "%1"

Once you have set up the association, you will be able to double click on script files in File Manager to launch the app. 

Note that if either the location of wish or the location of the script contains spaces in any of the file names, you must enclose the
name in quotes. For example: 

"c:Program Files	clinwish83.exe" "c:Program Filesmyscript.tcl"

-Scott Stanton 

You may also want to add an Edit action for Tcl files. For this, you need to pick an editor that won`t place extra carriage returns on
the end of lines. (Windows uses a carriage return/line feed combination to end each line of text, while Unix only uses a line feed.) 

In the Windows 95 Explorer, pick the Options choice from the View menu. Under the File Types tab, find your Tcl file type and Edit
it. Under Actions, click New and name your new Action Edit. Choose your editor and accept all your changes. 

You should now be able to easily bring up an editor with a right-click on the file and the Edit popup option. 

-Hume Smith