Happy Holiday HTA

Send an HTA greeting card this holiday season


Once in a while it’s fun to do something a little different with scripting. For example, I created a HTML Application (HTA) that’s a greeting card for the holiday season. HolidayTree.hta uses basic timers with randomized colors to produce a colorful holiday tree with blinking multicolored lights and a Happy Holidays greeting (see Figure 1). You can find HolidayTree.hta in the 100488.zip file by clicking the Download the Code Here button, above. To “open” the card, simply double-click the HolidayTree.hta file.

If desired, you can easily personalize the greeting and change the color of the tree lights and the background. To change the greeting, open the file in Notepad and find the code

 <p align="center"><b>
  <font size="7" color="#800000">
  <span style="font-family: Brush
  Script MT"> Happy Holidays

Replace Happy Holidays with your greeting.

To change the color of the tree lights or background, you need hexadecimal color codes. I included the AddColor.hta in the 100488.zip file for this purpose. In the Add- Color.hta’s UI, click the Rainbow Chart button to create a red-green-blue (RGB) color chart in Microsoft Word. This chart consists of 180 different colored cells. Inside each cell is the RGB value that creates the color. After you find the color you want, you can convert the RGB number into the hex code in AddColor.hta. (If you’d like more information about AddColor.hta, see the VIP exclusive article “Add a Little Color to Your World” at windowsitpro.com/article/articleid/47800/add-a-little-color-to-your-world.html.)

After you have the hex codes for the colors you want to use, plug your hex color codes into HolidayTree.hta. The code

 <body bgcolor="#008080">

sets the background color. The code

 str = "#FF0000,#FFFF00,#FF00FF," & _
  str = str &
  ",#FF8C00,#FF1493,#FFCC00," & _

sets the color of the tree lights. Happy holidays to you all!

—Jim Turner, domain administrator and applications developer, Computer Sciences Corp.

See associated figure

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.