@DATABASE "TTX"
@AUTHOR Mike Archer
@NODE main "  TTX 1.0                                        ©1999 Mike Archer"


                            ###### ###### ##   ##
                              ##     ##    ## ##
                              ##     ##     ###
                              ##     ##    ## ##
                              ## o   ## o ##   ## o

                               (ToolType eXecute)


                              ©1999 by Mike Archer

                                   --=*=--

                                 @{"What is TTX ?" LINK "whatisit"}

                                 @{"INSTRUCTIONS" LINK "instructions"}

                                 @{"DISTRIBUTION" LINK "distribution"}

                                 @{" LEGAL  BIT " LINK "legalbit"}

                                 @{"   FUTURE   " LINK "future"}


@ENDNODE

@NODE whatisit     "  TTX 1.0                 What is TTX ?          ©1999 Mike Archer"

       TTX is a small (720 bytes) utility that allows you to run commands
     before and after a program is run from workbench.

       I  wrote  this utility because I was sick of copying games onto my
     hard-drive  only for them to ask "Please insert volume GameDisk:  in
     any  drive".  Previously when this happened I had to create a script
     file  to  assign the disk-name to the directory on my hard-drive and
     give  it  a  project  tied  into  IconX.   (You  must have done this
     countless times yourself!)

       Now all I need to do is use TTX!!!


                                    @{"How do you use TTX then ?" LINK instructions}

@ENDNODE


@NODE instructions "  TTX 1.0                 Instructions           ©1999 Mike Archer"

       Using  TTX  is  easy.   First you must install it into a directory
     that workbench looks for commands.  "SYS:Utilities" is a good place.


       Now  when  you  get  a  program  that you wish to execute commands
     before/after you simply.....

	(1) Select the icon and bring up the Information window. ([A] + i)

	(2) Change the icon type from "Tool" to "Project".

	(3) For  each  command  you  wish to run before the program add a
            ToolType called TTX_BEFORE.

        (4) For  each  command  you  wish  to run after the program add a
            ToolType called TTX_AFTER.

        (5) Make the default tool for the icon TTX.

     And that's it!




     EXAMPLE 1: PucMan Worlds

       PucMan worlds works fine on a hard-drive, but the map editor looks
     for  the  level  data  on the volume "PucMan2".  So select the MapEd
     icon, change it's type to "Project", Make the default tool TTX.  and
     add the following ToolTypes..

                        TTX_BEFORE=ASSIGN PucMan2: ""

                        TTX_AFTER=ASSIGN PucMan2:


       Now  when you double-click the MapEd icon, workbench will treat it
     as  a  project file (rather than a program) and pass it to TTX.  TTX
     will  search through the ToolTypes for any TTX_BEFORE tooltypes.  It
     will find the command..
                               ASSIGN PucMan2: ""

       Before  it  executes this command it sets the current directory to
     the  directory  that  the  MapEd  program  was  in.   (Yes, move the
     directory and the assign will still be correct!!)

       Now  it  will  execute the program with the same name as the icon.
     "MapEd"

       Once you exit from MapEd, control will be passed back to TTX which
     will  then  look  for  any  TTX_AFTER  tooltypes.   It will find the
     command...
                               ASSIGN PucMan2:

       This  will  remove  the assign created for the program to run, you
     system  is  back to normal.  I think this system is much easier than
     IconX, what do you think ?




      EXAMPLE 2: Deluxe PacMan

        Deluxe PacMan wont work on my machine because it doesn't set it's
      copperlist up properly.  To get it to work you need a degrader type
      utility.  I use RUNIT with the SCRBLANK parameter.  So again rather
      than   create   a   script   file  to  do  this  I  simply  changed
      "DeluxePacMan"  to  a project icon, gave it TTX as the default tool
      and then added into the tooltype...

                          TTX_BEFORE=RUNIT SCRBLANK

      EXAMPLE 3: MagicTV

        MagicTV  is  a useful commodity, but it causes the screen display
      to flicker on programs written in AMOS (and many others that set up
      their  own  custom  copper lists and leave task-switching enabled.)
      With the program "CxCommand" you can disable/enable any commodities
      that  are  running,  so you can use ttx to switch of MagicTV before
      the  program  runs and to switch it back on again afterwards.  This
      is done as follows....

			TTX_BEFORE=CXCOMMAND "MagicTV V1.0" disable
			TTX_BEFORE=WAIT 2
			TTX_AFTER=CXCOMMAND "MagicTV V1.0" enable

        Note:   When  using  CXCOMMAND  you  must  give  the  name of the
              commodity that you wish to disable exactly as it appears in
              the Exchange window listing commodities running.  (Capitals
              and lowercase must be correctly typed)


@ENDNODE

@NODE distribution "  TTX 1.0                 Distribution           ©1999 Mike Archer"

       This program is freeware, copyright remains with the author. You
     may  use/distribute  this  program freely as long as the program and
     accompanying files are kept with the program and remain unchanged.

       The  source to this program is provided and you are free to change
     the  program  in  whatever  way you want, but if you distribute your
     changed  version  please  make  sure  you  either put remarks in the
     source  to  highlight  what you have changed or distribute both your
     version   and   the   original  version  together.   (I  don't  want
     bug-reports about other peoples code :(

@ENDNODE

@NODE legalbit "  TTX 1.0                   Legal Bit            ©1999 Mike Archer"

       This  program  comes  with no warranty, if you use it you do so at
     your  own  risk.   No liability what-so-ever will be accepted by the
     author  or  distributor  of  this program for any problems caused by
     it's  use or misuse.  If you do not agree with this, then do not use
     the program.

@ENDNODE

@NODE future "  TTX 1.0                      Future              ©1999 Mike Archer"

       I  hope to release a new version of TTX in the future.  It depends
     on  if  I  get time to suss out what I want it to do.  I hope to add
     the following features...

     * Launch  the  program  whose  icon  was clicked as a WorkBench task
       rather than a CLI command. Some programs need TTX and also look at
       their icon for ToolTypes.  Run them from CLI and the ToolTypes are
       ignored. (This problem occurs using IconX too)

     * I would also like to code the features of RUNIT and CXCOMMAND into
       TTX,  rather than have to call external programs.  However I don't
       have  the  time  to do this at the moment, if anyone fancies using
       the  idea  behind  how  TTX  works  and doing this, they are quite
       welcome  to  use  my  source-code  (included).  I don't expect any
       credit,  just  make  your final release Public Domain or Freeware.

@ENDNODE
