[Pythonmac-SIG] ASTranslate and appscript question

has hengist.podd at virgin.net
Fri Mar 28 22:51:15 CET 2008


Robert Pyle wrote:

> 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
> ---------

'set volume' is a Standard Additions command, not a Finder command.  
ASTranslate only translates application commands; scripting addition  
commands aren't currently supported. You'll need to export the  
Standard Additions dictionary using ASDictionary and translate the  
original AppleScript commands yourself.

Anyway, the following code should work (you don't need to target the  
Finder for this, btw; the current process will do fine):

import osax

sa = osax.ScriptingAddition()

sa.set_volume(output_volume=100)
sa.set_volume(input_volume=35)

HTH

has
-- 
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net



More information about the Pythonmac-SIG mailing list