What's it doing?

This is how Shorts works.  I mention this so maybe some people can see some problems and fix them or at least be aware of them.

Shorts gets a list of all the files in the folder you specify including subfolders.

As each filename is checked to see if it is greater than the limit.  If the limit is 12 characters there is an added check.  Shorts checks if the file extension is more than 3 characters.

If either is true, a new name is generated.

The name (new or original) is checked to see that it doesn't match something else already in current folder.  If it is another name is generated.

Once a name that passes is found it is associated with the original name (internally)

After all the names have have a new name associated with them Shorts walks the list again and copies all the files from their old name to their new name.

If the file ends in .HTM, .HTML or .JS then Shorts searches through the file and finds all *strings*.  A string in this case is defined as the text between either two single quotes or two double quotes that are on the same line.  Quotes can be escaped in the C/C++ style.    Examples:

"apple"
'orange'
"\"banana\""

This string is then checked to see if it matches anything in the current folder.  The current folder is the folder that this HTML,HTM,JS file is in.  This is a potential problem.  As there is no way for me to know all the HTML tags that might have filenames I just have to check them all.  That means for example in HTML you can do things like this

<font color="white">

Shorts is going to check if there is a file called "white" in the current folder and if there is it's going to change "white" to whatever the new name is.  This is probably generally not a problem.  One, "white" is not less than 12 characters so it would never be renamed so the *new* name would also be "white" (or "WHITE") if you've set the "make UPPER" option.  Two, it's just not that likely there's going to be a match.

Generally it will see something like this

<img border="0" src="my picture.jpg">

"0" will be checked.  No match.  "my picture.jpg" will be checked.  If you've set maximum characters to 12 then "my picture.jpg" will probably become "my00000.jpg".

Another common example would be something like

<a href="../../index.html">Homepage</a>

In this case the string is broken up by *FORWARD SLASHES".  So first ".." is seen.  This says to back up a folder.  Then the next ".." is seen backing up another folder and finally "index.html" is seen which if you've set maximum characters to 12 would have been renamed to "index.htm"

One other thing that happens.  If a '?' (question mark) is found in the string the check stops there.  So for example

<a href="../../thumbs_d/slideshow.html?456">Slideshow</a>

Only "../../thumbs_d/slideshow.html" is checked.  This is my *hack* as I wrote Shorts pretty much only to support Thumbs and that's all Thumbs needs to work.


<<< back to my shorts