Thursday 19 February 2015

Tasker - making use of javascript

Yesterday I posted about using WatchMaker with Tasker for automation, and I built a watch face that used Tasker to update variables which were displayed on screen.  Here it is...


World Community Grid - 20 downloads


However, it bugged me that I couldn't quite get it to look right, I wanted to add thousand markers to the rank (#215,027) and points (181,052).  I couldn't figure out a way to do this in WatchMaker, or in Tasker, until I discovered the javascript option.  In Tasker you can add a step in the task which runs javascript, which can access the global variable that you've already set, re-format it, and then set the global variable again.  Here's what I did...




I'm not going to explain the javascript, because that's not really the point, but you can find out more about the javascript API and what's available in Tasker here... http://tasker.wikidot.com/userguide-en:javascript.

The end result is this...


It's a small difference, but I think it looks much better.  And I love that I found a way to make the watch display exactly the way I wanted.

No comments:

Post a Comment