http://manual.audacityteam.org/man/Scripting says: “The scripting module is an experimental GUI plug-in that allows Audacity to be driven from an external Perl script. Commands are sent to Audacity over a named pipe. Any scripting language that supports named pipes can be used in place of Perl.”
In order to activate it you have to compile Audacity yourself.
I’m no Applescript expert (by a long shot ) but I seem to recall an AppleScript extension that will expose a program’s GUI so it can be scripted even if it does not have built-in support for AppleScript (which Audacity does not). Then it is a matter of whether or not the Track Drop-down Menu is exposed as a GUI element.
The first link mentions UI Browser as a paid but free-for-30-days tool that might be useful for finding out how to script the drop-down box: http://pfiddlesoft.com/uibrowser/
I’ll try it and report back.
(It also turns out that Mac OS X Automator has a “Watch Me Do” feature that might do the trick, I haven’t explored that at all.)