Control of apps while driving. (Macros?) I want to create a few simple macros which I can activate while driving. At the moment, for safety I would need to park the car in order to use the GUI. 

What I'm after (if it's possible) is to assign to a trigger (such as shaking the phone, which I can do while driving without taking my eyes off the road) to a series of taps or the clicking of a button etc.

Can one app control another in this way? And can macros be recorded which would for example, click on an item in a list, and then when a new screen pops up, click a GUI button in it?

Specifically, I listen to a number of di.fm radio station streams in the car and want to be able to change between them. DI.fm has a custom app for this, but their stations are also available as standards-compliant streams (mp3, aac) for 3rd party programs like WinAmp (which might have more accessible controls for switching between streams which could be managed by an additional 3rd party app)
Tasker can do that (and a lot more things), as long as the app in question supports it (a list of apps with Tasker support can e.g. be found here − never mind the German, if you're just after the list). As you've described, it supports "Shake gestures", and if your device has a camera button, you could utilize that as well. "Flip gestures" might also come in handy (flip the device to face down, then face up, etc.)

I know it's a paid app. But to try it out, visit the app's project site and get a 7-day trial (remember to export all your configuration and profiles before "day 7", then you can simply uninstall, re-install, and re-import your settings for another 7 days period − this hint comes from the dev himself, so it's nothing bad ;)

The app needs some time to get warm with it. But once you did, you don't want to miss it anymore :)