AppServer V1.2 -------------- NOTE ! WorkBech 2.0 or later required !!! Have you ever tried to drag an icon into the IconEdit's window ? IconEdit loads it automatically and you don't have to give any names. I liked that feature and wanted to see this feature in every utility I had. AppServer gives you the power of Application Windows. It is an Application Window Server for WorkBench 2.0. AppServer is a configurable front-end for utility programs. An example would be fine, I guess... You want to show a picture. You drag the picture file icon into AppServer's window and AppServer shows the picture using your favorite Iff-Viewer. You can as well make other windows which play samples, show documents etc. Configuration ------------- Configuration is done by icon tool types. If you don't know what a tool type is, mark the AppServer icon and select "Information" from the Icons menu. Supported tool types are: NAME= Name of the window to be opened LEFT= Window left coordinate TOP= Window top coordinate WIDTH= Window width HEIGHT= Window height COMMAND= This one is the most important tooltype. The command is a CLI-command that is executed from AppServer. In the command you mark the filename place with (icon) For example: COMMAND=SYS:Utilities/More "(icon)" The example would show the file with more. The quotes are added so that AppServer can handle spaces in filenames. They are not added automatically, because some utilities can't handle quotes. There may be multiple (icon)'s in a command string. NOTE ! AppServer is not limited to only one command- argument. You can give as many commands you want and they are executed one after other in the same order they appear in the tooltypes. OUTPUT= Output filename. Default is NIL:. If you want to output for example a dir list, the filename could be for example OUTPUT=CON:0/0/640/200/AppServer PAUSE= Time to wait after executing the command. Default is 0 seconds. If you want to view dir lists to console device, you have to give a pause value or the list disappears immediately. You should configure the AppServer by creating own Project- type icons. In the Project-type icons write a path to the AppServer into the Default Tool field. If you only duplicate the AppServer-icon and reconfigure it, you waste disk space. The AppServer-icon is configured to show document files using more. There's a Project-type icon, AppMore, that does the same thing. You can use it as an example. Graphics -------- An empty window would look horrible. I'm not good at drawing... Hmm... The solution is icons. AppServer takes the image from your Project-icon and draws it in the middle of the window. Now it's up to you to draw good-looking icons :-) Techical stuff and possible problems ------------------------------------ AppServer can't be run from CLI. If you want to start AppServers at boot- time, drag the icons to the WbStartup-drawer. If you don't give any COMMAND-arguments, AppServer will start, but doesn't do anything useful. AppServer launches the programs using Execute from dos.library. This execute is about the same as run in CLI. It's not the Execute in CLI. AppServer doesn't show with requesters if the command was succesful. While building the command you can change the output to a file or console so that you can notice the error messages. Don't assume that the default dir would be in the same dir as the icon you just dragged into AppServer. It isn't possible to change the current dir, so you have to keep this problem in mind if you use scripts. AppServer waits until the previous command has been executed. If you want to be able to execute the next command before the previous has been completed use RUN just like in CLI. You can't use AppServer to make an ultimate Trasher. (A trashcan that kills every file.) There are two reasons: First of all, I haven't been able to figure out how to remove an icon from a WB-window or close WB-windows. The second reason is that AppMessage contains locks to dirs, so that you can't kill the dir. This isn't a big problem and I promise to allow deletion if someone tells me how to remove icons and WB-windows :-) The executable is about 5 K. The startup-part of the program is about 1 K and is returned to the memory pool by a segment split. AppServer was coded in Assembly using ArgAsm from Argonaut Software. Changes ------- V1.1 AppServer opened and closed the output file and delayed at every command. It wasn't nice when executed many commands to the console. Now I open the file before the first command and delay and close it after the last command. V1.2 Filename and windowname were not null-terminated. Argh... Copyright and distribution -------------------------- AppServer is Copyright © 1991 by Jarto Tarpio. It can be freely distributed for non-commercial purposes. Comments and bug-reports to: Jarto Tarpio Nikkarinkuja 2 A6 02600 Espoo Finland Internet e-mail: robin@vipunen.hut.fi