Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Since OS X 10.5, OS X has shipped with the <a href="http://pyobjc.sourceforge.net/" rel="noreferrer">PyObjC</a> bridge, a Python-Objective-C bridge. It uses the <a href="http://bridgesupport.macosforge.org/trac/" rel="noreferrer">BridgeSupport</a> framework to map Objective-C frameworks to Python. Unlike, MacRuby, PyObjC is a classical bridge--there is a proxy object on the python side for each ObjC object and visa versa. The bridge is pretty seamless, however, and its possible to write entire apps in PyObjC (Xcode has some basic PyObjC support, and you can download the app and file templates for Xcode from the PyObjC SVN at the above link). Many folks use it for utilities or for app-scripting/plugins. Apple's developer site also has an <a href="http://developer.apple.com/cocoa/pyobjc.html" rel="noreferrer">introduction</a> to developing Cocoa applications with Python via PyObjC which is slightly out of date, but may be a good overview for you.</p> <p>In your case, the following code will call <code>[NSSpeechSynthesizer availableVoices]</code>:</p> <pre><code>from AppKit import NSSpeechSynthesizer NSSpeechSynthesizer.availableVoices() </code></pre> <p>which returns</p> <pre><code>( "com.apple.speech.synthesis.voice.Agnes", "com.apple.speech.synthesis.voice.Albert", "com.apple.speech.synthesis.voice.Alex", "com.apple.speech.synthesis.voice.BadNews", "com.apple.speech.synthesis.voice.Bahh", "com.apple.speech.synthesis.voice.Bells", "com.apple.speech.synthesis.voice.Boing", "com.apple.speech.synthesis.voice.Bruce", "com.apple.speech.synthesis.voice.Bubbles", "com.apple.speech.synthesis.voice.Cellos", "com.apple.speech.synthesis.voice.Deranged", "com.apple.speech.synthesis.voice.Fred", "com.apple.speech.synthesis.voice.GoodNews", "com.apple.speech.synthesis.voice.Hysterical", "com.apple.speech.synthesis.voice.Junior", "com.apple.speech.synthesis.voice.Kathy", "com.apple.speech.synthesis.voice.Organ", "com.apple.speech.synthesis.voice.Princess", "com.apple.speech.synthesis.voice.Ralph", "com.apple.speech.synthesis.voice.Trinoids", "com.apple.speech.synthesis.voice.Vicki", "com.apple.speech.synthesis.voice.Victoria", "com.apple.speech.synthesis.voice.Whisper", "com.apple.speech.synthesis.voice.Zarvox" ) </code></pre> <p>(a bridged NSCFArray) on my SL machine.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload