[OS/2 e-Zine! - Now on CD (Click here).]

The OS/2 Project

If you're looking for interesting and innovative ways to take advantage of OS/2's power, or if you just want a neat trick to impress you're friends, this is the place to look! "The OS/2 Project" chronicles small endeavours intended to improve our systems, make us more productive and just generally make our lives easier.

In this issue, one Vancouver OS/2 user tells us how he and another member of the TEAM OS/2 Vancouver SIG created a program they call "Spike", a neat utility that allows users to store clipboard data. It uses only one very small and simple executable and OS/2's built-in association model.

* * *


Over time, what I found I needed on OS/2's Desktop was a place to quickly place and save clipboard data that I wanted stored for future reference. In the past, I had to copy to the clipboard, make a temporary text file, place the text file on the Desktop for easy access, open the file, append the data, then close the file. I found this procedure rather tedious, so I called a good friend, and asked him if a simple tool could be made....

His response was enthusiastic and he suggested that I make an icon for it. He further suggested that the icon would take more time than the actual program. He was right!

What You Will Need

For this project, all you will need is the "Spike" program. This can be downloaded from the Vancouver OS/2 Users Group Home Page (click the "Links" button), Hobbes, the OS/2 Supersite or directly from OS/2 e-Zine! (ZIP, 27k).

Installation / Setup

When we created "Spike", we discussed the method of installation and decided that we would not write an installation script. This decision was made so that we could use Spike as a lesson in OS/2's association methods. Most of us already know how to use common associations with .EXE files. This project will show you how to make a new data file type, associate it with a SPIKE.EXE file, and then make the data file into a template. The reward for going through this lesson will be a free utility that I think a lot of you will find useful. Plus as a benefit, you will be able to use this knowledge in many other areas.

To "install" Spike, just unzip the archive into the directory named "\Spike". For example, if you have downloaded spike.zip to your C: drive, the directory would be "C:\Spike".

Open your template folder, drag off a DATA FILE template. Drop it into the same open template folder. Change the name to SPIKEFILE.

Next, go to the first page of the Properties notebook of the new SPIKEFILE (the TYPE page) by right clicking on the "SPIKEFILE" object and selecting "Properties" from the pop-up menu. Click in the "NEW TYPE:" entry field and type in "SPIKEFILE". To the left of this entry field there is a push button labelled "<< New"; click it. This adds a new data type to the list of available types (if you scroll down the "Available types" list, you'll see "SPIKEFILE" there now).

After doing this, look at the CURRENT TYPES box; notice that the current type listed is "Plain Text". This is the default type for all data files. Highlight the "Plain Text" selection and hit the "<< Remove" push button. Next, scroll down through the types available and select your new type ("SPIKEFILE"). Then, after highlighting the SPIKEFILE selection, push the "Add >>" push button. This adds the "SPIKEFILE" selection to the Current types (GIF, 7.6k) and makes SPIKEFILE the first or default action that is invoked when you click on its icon later.

Now scroll through the list and find the "Plain Text" selection that we removed before. Highlight it and use the "Add >>" button to put it back in the "Current types" list. This allows for two associations; the first one is an association to the data type "SPIKEFILE", and the second to the "Plain text" type.

For the moment we are finished with this data file (just leave it open); now we will set up the actual executable file. Drag a Program object onto the Desktop from the Templates folder, and enter "C:\Spike\spike.exe" in the "Path and file name" field. Now add the SPIKEFILE to its association settings. Click the "Association" tab and from the "Available types" list, select "SPIKEFLE" then push the "Add >>" button. Click on the "Icon" tab and change the name "Program" to "Spike" and close the Properties notebook.

[Icon tab graphic]Now to finalize this lesson, we go back to the open SPIKEFILE Properties notebook and select the "Icon" tab. Ensure that the title is "Spike File" or a similar name then click on the "Template" check box and close the notebook. This allows us to rip off as many SPIKEFILES as we need to deal with as many different subjects as we want.

To tidy up the installation process drag the SPIKEFILE program object off the Desktop and into the Spike folder. You can also make a copy of the SPIKEFILE template and place it in this folder as well by dragging the SPIKEFILE template while holding down the Ctrl key. Now rip off a template and keep it in this folder, rename it for applicable use and then create a shadow for it on the desktop. You can repeat this last process for as many "Spikes" as you need on your Desktop for various purposes. Using this method you always keep your data files in a directory on the drive and can delete any shadow not required from the Desktop at any time.

Putting It to Use

What? That's it? Yep, that's it!

[SPIKEFILE object graphic][SPIKEFILE object graphic]To use the SPIKEFILE, simply drag a SPIKEFILE template from the Templates object you created and drop it wherever you wish. If you want, rename the new SPIKEFILE object with some relevant name. Now when you have a clipboard full of data you wish to save, simply double click on this object and the text contents of the clipboard will be appended to this data file with a separator line between each insertion. (Note, graphical contents of the clipboard will be ignored.)

If you wish to read or edit the file, right click on the SPIKEFILE object you have torn off to bring up its menu. Select the arrow to the right of "Open as" and select the editor from the pop-up menu that you have associated with "Plain text" (this is why we added the "Plain text" association back in to the "Current types" list of the SPIKEFILE Properties notebook). An editor window appears with all the clipboard contents you've been adding!

If you suddenly find you have more data in your clipboard that you want to save but that is not related to the tidbits you've saved earlier, rip off another SPIKEFILE template, drop it on the Desktop and double click it. You've just started a new Spike file!

Other Stuff

We chose the name "Spike" to be reminiscent of the spike found on desktops in many offices. This is the place where memos, invoices and Post-it notes go after they have been read or while they are awaiting filing. It looks like a spike mounted on a pedestal. Have a look at the icon for "Spike" and you'll know what we mean...

SPIKE was created by a couple of members of TEAM OS/2 Vancouver, BC SIG. It is freeware. All we ask is that you include all files when passing it on to others. There is no support from the authors and we ask that you help others users requiring help as your "dues" for the free software.

That's it... enjoy!

* * *

Thanks for this issue's OS/2 Project go to two very generous and anonymous members of the Team OS/2 Vancouver SIG.

If you have questions or suggestions for improvements to this project, let us know. Until then, enjoy!

* * *

Tools used in this project:


by Team OS/2 Vancouver Members
download from the OS/2 Supersite (ZIP, 27k)
Registration: FREE


[Our Sponsor: Indelible Blue - OS/2 software and hardware solutions to customers worldwide.]

Copyright © 1998 - Falcon Networking ISSN 1203-5696