Tuesday, February 16, 2010

Importing external scripts in same directory in Applescript

I started dabbling in Applescript the other day and rather quickly ran into an annoying limitation. Applescript has a mechanism for loading external scripts, but it requires absolute paths. I like keeping my code portable, and that means absolute paths aren't allowed. After some experimenting and digging around online I finally managed to find a solution.

Thursday, February 11, 2010

Asynchronous unit tests in FlexUnit 4

FlexUnit looks like a fairly decent Flex unit testing framework and we've started using it in our new Flex project. Unfortunately FlexUnit has pretty much zero documentation, so unless you can find a blog post from someone about how to do something you'll have to just figure it out from scratch.

My coworker and I end up having to dig into the FlexUnit code occasionally to figure out how things work. The latest instance of this for me was to try and figure out how to test asynchronous events. I found a couple posts showing that it was possible with basic examples, but no real explanation of the different options.

I've managed to get a few different types of async tests working, so I figured I'd give examples of the different async methods provided by the Async FlexUnit class.

Thursday, February 4, 2010

Shortcut for enabling/disabling wireless device (or any device)

Most laptops these days have a switch or button to toggle the wireless device.  Turning off wireless is a good way to save battery, and having a shortcut to turn it off is nice.  The switch on the previous laptop I had would completely turn off the device.  However, the new laptops we got at work seem to only turn off the antennae.  Power-wise this is fine, but Windows continually opens one of the bubble notifications to tell me that the wireless isn't connected.

Nothing is broken, but it started getting really annoying to have to dismiss that notification a couple times an hour.  Extra annoying is the fact that Windows provides a checkbox that looks like it should turn that behavior off, but even with that unchecked it still bugs me.