PowerPaste

Download PowerPaste.js
Author: sam AT sam-i-am.com
last modified: Wednesday, August 09, 2000

Nifty and suprisingly powerful tool for replicating some text a number of times. This in incredibly useful for example when beginning to mark up a dhtml page, where you need lots of DIV tags, IDs, classes, etc.. that differ only slightly, and to a pattern... Huge time and tedium saver.

PowerPaste gives the ability to paste a block of text any (given) number of times. It supports one or more insertion markers - to be replaced by either:

Useage (by example):

powerpaste in action screenshot - first prompt

screenshot

Type and select
<DIV ID="layer[*]">this layer has the ID: [*]</DIV>
Then hit your PowerPaste button.. you will be prompted for "the text you want to paste". The selection will appear as the default value. Hit OK. You will be prompted for "repeat how many times?". Power Paste accepts a few alternatives at this point:

Incremental Mode (zero-based):
Enter a number. Entering 3 gives me:
<DIV ID="layer0">this layer has the ID: 0</DIV>
<DIV ID="layer1">this layer has the ID: 1</DIV>
<DIV ID="layer2">this layer has the ID: 2</DIV>
<DIV ID="layer3">this layer has the ID: 3</DIV>
Range Mode:
Enter a numberic range. Entering 6-9 gives me:
<DIV ID="layer6">this layer has the ID: 6</DIV>
<DIV ID="layer7">this layer has the ID: 7</DIV>
<DIV ID="layer8">this layer has the ID: 8</DIV>
<DIV ID="layer9">this layer has the ID: 9</DIV>
List Mode:
Enter a comma delimited list of values. Entering a,bee,sea,dee,8000 gives me:
<DIV ID="layera">this layer has the ID: a</DIV>
<DIV ID="layerbee">this layer has the ID: bee</DIV>
<DIV ID="layersea">this layer has the ID: sea</DIV>
<DIV ID="layerdee">this layer has the ID: dee</DIV>
<DIV ID="layer8000">this layer has the ID: 8000</DIV>
powerpaste in action screenshot - second prompt

screenshot of the second prompt