[Pythonmac-SIG] ASTranslate and appscript question

Robert Pyle rpyle at post.harvard.edu
Fri Mar 28 21:35:22 CET 2008


Hi,

 From a python program, I'm trying to set the input and output gains  
of a USB audio interface (M-Audio Transit).  Using ASTranslate, I've  
been able to write appscript code to manipulate the "Sound" preference  
panel of "System Preferences" to find and make note of the current  
sound input and output devices, select the Transit as the default  
device, and then restore the prior default device (which may or may  
not be the Transit).

What I can't do so far is figure out how to set the gain while the  
Transit is selected.  When the Transit is the selected default device,  
this AppleScript sets the gains as I want:

---------
tell application "Finder"
	set volume output volume 100
	set volume input volume 35
end tell
---------

which ASTranslate renders as:

---------
Untranslated event 'aevtstvl'

Untranslated event 'ascrgdut'

Untranslated event 'aevtstvl'

Untranslated event 'aevtstvl'
---------

Running the AppleScript twice in a row gives only two 'aevtstvl'  
events (I'm guessing the last two), without the 'ascrgdut'.

Can anyone help me to produce appropriate appscript code?  Examples?   
Documentation? (I've looked at everything I can find.)

Thanks.

Bob Pyle





More information about the Pythonmac-SIG mailing list