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.