Sleepy Weim

ActionTiles: Countdown Image

My wife and I are big fans of trips and going on various adventures. While I was looking for things I could do with ActionTiles, I realized writing a script that would calculate the countdown to our various trips would be fun and useful.

As always, ActionTiles needs anything you want to load in a media tile to be an image, so I had to look into how I could create a new image, write text to it, and then save it out. Linking an image in ActionTiles is straightforward once you have it, so generating it is the interesting part.

Of course, I can’t leave things alone. After figuring out how to create the basic image and numbers, I then wanted to figure out how to change the font, and then how could I change up the background. Then I wanted to tweak the font layout depending on the background.

I wanted to make it a bit simpler, but I get picky about layout. Since so much is customized per image, I found it to be overkill to put it into a function since you end up passing so much per image. Oh well.

What you end up needing to decide on:

  • Date of the Event
  • Font
  • Background Image to Add
  • Pixel Adjustment (move the numbers up or down)

Ready for the script? Here you go: code.

Leave a Reply