How to Strip Scripts for Reuse

Now we get to the nitty-gritty. Everyone has seen a script that they want to strip and use themselves. But how is it done? It seems so complicated! Follow along.

First, in Outlook Express, locate the stationery post. Click on it and press CTRL-F2. The script is loaded automatically into the Windows Notepad text editor. Let's use a simple script example which contains two images and a sound file:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"><BASE
href=file://D:\lettermanstationery\>
<STYLE>BODY {
   FONT-SIZE: 12pt; MARGIN: 0px; COLOR: #000000; FONT-FAMILY: arial
}
</STYLE>
<BGSOUND balance=0 src="cid:016101c007c1$060ef520$423fa2ce@f5q7j4" volume=0>
<META content="MSHTML 5.50.4134.600" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff>
<DIV> </DIV><IMG src="cid:015f01c007c1$0605cd60$423fa2ce@f5q7j4"
border=0><BR><IMG src="cid:016001c007c1$0605cd60$423fa2ce@f5q7j4"
border=0><BR></BODY></HTML>

Notice I've highlighted certain areas in the script we'll be stripping and changing. The areas in yellow can always be removed, and should be removed for your own clarity. These include all <DOCTYPE> tags, <META> tags, and <BASE> tags. The tags always start with a < symbol, and end with a > symbol. Remove everything within, including these symbols.

The areas highlighted in blue must be modified. These are the cid (Content-ID) numbers which identify the files. In this script, they are the two images and one sound file. In place of the blue highlighted area we will substitute the file names of each file. But before we can do that, we need to determine which file is which. This is the confusing part to many people.

The sound file is the obvious one. It is the <BGSOUND> statement. Delete the blue area (the cid) and replace it with the file name of the sound file. You must use the full file path. See Specifying the Full File Path on the Tips page. The file name should rest wholly within the double quotes, as in src="file:///C:/folder/piano3.mid"

The image files are not so obvious. Let's figure out which goes where. Click on the post again, then press CTRL-F3. Maximize the window. This is the BASE-64 encoding which describes the post. It is what is sent (and received) by Outlook Express.

Scroll down past the heading information at the top and you will start to see sections with large blocks of numbers and letters. These numbers define the images and sound. Each is identified with a cid number. I have highlighted the first four digits of each of the three cid numbers in green. Just above each cid number is the name of the file associated with it, highlighted in yellow. The image type (or sound type) is highlighted in blue. Using this number we will be able to identify which image belongs where in the script.

------=_NextPart_000_0162_01C00786.59C88720
Content-Type: image/gif;
      name="balloon.gif"
Content-Transfer-Encoding: base64
Content-ID: <015f01c007c1$0605cd60$423fa2ce@f5q7j4>

R0lGODlhMgBVAJH/AFJSUgBmmMDAwAAAACH5BAEAAAIALAAAAAAyAFUAQALrlI+py+2fQJi02gqg
lrd7m2kK95VeKC6k2aFpCqzYS4tujTN3zh97j/sBg8OgbCIcHlkt3pL5SUKe0FmReiraQFpn1/vN
ScONMfmMTvuwFHOwenE/2HD5CM60I+h4/R5v4hcBCCKoQ2i4kaemQhLDWCbwCDlFWWnpkBim+cV5
hZkJGilKWloTgzppiaV6xtfmeUcYEGvwGqU0y+WkGyfW23QK7Cs8bEVzC5WYzLJsjNTDnJWrW2uL

------=_NextPart_000_0162_01C00786.59C88720
Content-Type: image/gif;
      name="city.gif"
Content-Transfer-Encoding: base64
Content-ID: <016001c007c1$0605cd60$423fa2ce@f5q7j4>

R0lGODlhWAIEAfcAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwMDcwKbK8AAAADMAADMzADMzM2Yz
AGYzM2ZmM2ZmZplmM5lmZpmZZpmZmcxmM8yZZsyZmczMmczMzP8zzP8z//9mAP9mM/9mZv9mmf9m
zP9m//+ZAP+ZM/+ZZv+Zmf+ZzP+Z///MAP/MM//MZv/Mmf/MzP/M////AP//M///Zv//mf//zP//
///78KCgpICAgP8AAAD/AP//AAAA//8A/wD//////62ZhQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

------=_NextPart_000_0162_01C00786.59C88720
Content-Type: audio/mid;
      name="piano3.mid"
Content-Transfer-Encoding: base64
Content-ID: <016101c007c1$060ef520$423fa2ce@f5q7j4>

TVRoZAAAAAYAAQAFAMBNVHJrAAAAGQD/UQMHoSAA/1gEBAIYCAD/WQIAAAD/LwBNVHJrAAAKywD/
AwVQaWFubwD/IAEAALAHdwDAAIYkkEhngxSQSn8SgEgAghiQTH8YgEoAgkWATAAAkFNtB5AwOoEh
kDc+WYAwAGmQQEdGgDcAgy6QN00rgEAAgQGQME0rgDcAS4AwACaQL20CkDBAQoAwABeALwBIkC1/
gRmQNH8bgFMAgQ6QVH96kDlhgTCQU38ugFQAD4A0AFGQNEo/gDkAb5BPbRuAUwBjgE8AI5A5TUiA

Now return to the script in the first window, above. Notice the cid numbers associated with each image and sound file? These are the same numbers as are displayed in the second window, the CTRL-F3 window.

Match the cid numbers and substitute the associated file name into the script at the top. When complete, they will look like this: src="file:///C:/folder/city.gif" and src="file:///C:/folder/balloon.gif". It's that simple. When you have completed, your new script should look like this:

<HTML><HEAD><TITLE></TITLE>
<STYLE>BODY {
   FONT-SIZE: 12pt; MARGIN: 0px; COLOR: #000000; FONT-FAMILY: arial
}
</STYLE>
<BGSOUND balance=0 src="file:///C:/folder/piano3.mid" volume=0>
</HEAD>
<BODY bgColor=#ffffff>
<DIV> </DIV><IMG src="file:///C:/folder/balloon.gif"
border=0><BR><IMG src="file:///C:/folder/city.gif"
border=0><BR></BODY></HTML>

You can make the script even prettier if you'd like, by placing individual HTML tags on their own lines.

Set up a folder for the script, the images, and the sound file. Now save the modified script from Notepad to your new folder. Be sure to save it as an .HTM file. From the original post, save the image and sound attachments. Here is a repeat of the saving technique taken straight from the Letterman Answers page:

How do I save images and sound files from a post?
Once you have made the recommended Outlook Express options settings (see the Tips page), simply click on the post in question, then click the FORWARD button. The forward window (it's actually the compose window) will appear. Click on FILE|SAVE ATTACHMENTS to save all embedded files. If you have a Windows Explorer window visible, you can drag and drop individual files to another folder. You can also drag and drop them to the desktop.

Now you can run the original script by clicking on the .HTM script file.

Hopefully, stripping scripts is made easier by this tutorial.