If you jumped straight here, I get it. This code is for randomly selecting a photo from a directory, and saving it to a predefined location and filename. Very sexy, of course, so you couldn’t wait to get here and start running with it! Feel free to play with the code, break things, and then go back and read the main page where I explain why I do certain things. 😉 There are four main
One of the big things I was excited to do with ActionTiles was display photos. I have a huge folder of thousands of pictures organized on my local Synology that I also sync to Google Drive. Unfortunately, the options for trying to show rotating photos in ActionTiles was lacking (no offense guys!). After playing around with ActionTiles itself for a bit, I realized I could have a Media Tile with a URL that points at
In this example of my script I have a Disney and a Christmas countdown to show you the differences between a customized and a plain countdown. Even my plain countdown has a font specified. As with my previous code, you need to have Pillow installed. For the custom fonts, I added a ‘fonts’ folder in my script folder, and added the files there. On my Mac, I can open ‘Font Book’, look at my fonts,
So, this is pulling together the other two scripts I wrote (download and crop images). Really, this is just for you to see the iterations of what I did before I got here. I could have just jumped you straight to here, but it helps to see the individual components before getting more complicated in a single script. The standard walk before you run. This script takes the download script, the crop script, and then
While getting the images is important on it’s own, I ran into the issue of sizing with ActionTiles. The tiles I’m using to display pictures are 2×3, so they are basically a perfect size for a landscape oriented image. And even though I have a tablet that is larger than most, the size of each tile is not huge. Looking at the weather images, there was a whole lot of border that I really didn’t
Grabbing an image from a URL is fairly simple. In this script I create two string objects, define them with the URL, and then use the Retrieve method to save them into the folder.