

I chose SendGrid to send the emails because it required the least setup, I just needed to set up an account and I could send emails. To write the script I chose Python, which has a built in JSON parser library, and support for SendGrid's API. I am not going to lie, this piece of kit was not particularly difficult to write, but I believe is a good argument for why everyone should know how to write scripts and why public API's and libraries are awesome. Takes a list of participants and generates secret santa pairs.So I ended up with the following requirements: A log file also needed to be produced (and promised not to be looked at. I also wanted to automate the emailing process, which was required to keep the information for who had who, away from me. I want to keep everyones secret santa information secret, without even me knowing it. This Christmas season I found myself running a secret santa, completely over the internet. It also includes a list comprehension, a feature not natively present in javascript, to count from 1 to 6 and show a message for each count. Below is a script which defines a javascript object, a function to format that object and then shows the formatted alert. This script uses the ShowMessage(str) function, which is the Altium version of alert(str). To test this out I decided to write a simple script that would show a message in Altium when run. However, the versions of the tools may be useful to know, as they may dictate how effective this method is. These languages compile to valid Javascript, and can result in more maintainable scripts (assuming you can maintain the compiler version).įor this project I used a pretty simple set of tools. I have not seen many articles which reference this, and I find it interesting, because it means you can use Javascript transpilers to write your scripts in languages such as CoffeeScript. This version of Javascript implements what appears to be an ECMAScript 5 compliant version of javascript, and as a result you can apply javascript design techniques to your Altium Scripts. You can read more about Altium Scripting here, but it turns out the main languages you can use are DelphiScript, VisualBasic and Javascript (called JScript in the Altium documentation). There is a built in scripting engine and API which is mostly exposed using an Object Model.

Altium is a powerful program which can be scripted.
