Using NSSpeechStatusNumberOfCharactersLeft to update a progress indicator for NSSpeechSynthesizer
<p>I'm new to <code>Swift</code> and <code>OS X</code> programming.  I'm trying to use a progress monitor to indicate the progress of my speech synthesizer speaking text.</p>

<pre><code>let speechSynthesizer = NSSpeechSynthesizer()
speechSynthesizer.delegate = self;
speechSynthesizer.startSpeakingString(contents)
</code></pre>

<p>I would like to set</p>

<pre><code>progressIndicator.maxValue = Double(NSSpeechStatusNumberOfCharactersLeft.characters.count)
</code></pre>

<p>and then periodically update the progressIndicator with <a href="https://developer.apple.com/reference/appkit/nsspeechstatusnumberofcharactersleft" rel="nofollow">NSSpeechStatusNumberOfCharactersLeft</a>, which according to Apple's documentation should hit 0.</p>

<p>Every way I try to access this key, it returns the same inaccurate number, so I'm obviously not using it correctly.  The only example I found was in <code>Objective-C</code></p>

<pre><code>NSNumber *n = [[self.speechSynth objectForProperty:NSSpeechStatusProperty error:NULL] objectForKey:NSSpeechStatusNumberOfCharactersLeft];
</code></pre>

<p>and I tried to translate that to <code>Swift</code>, but still, no dice.</p>

<pre><code>let count = try speechSynthesizer.objectForProperty(NSSpeechStatusProperty).objectForKey(NSSpeechStatusNumberOfCharactersLeft)
</code></pre>

<p>I've also tried</p>

<pre><code>speechSynthesizer.valueForKey(NSSpeechStatusNumberOfCharactersLeft))
speechSynthesizer.valueWithName(NSSpeechStatusNumberOfCharactersLeft, inPropertyWithKey: NSSpeechStatusProperty))
</code></pre>

<p>which throw runtime exceptions.  Any thoughts?  Thanks in advance!</p>