NSTextView and the Text to Speech system shortcut

  • I am overriding the startSpeaking message in an NSTextView subclass so
    I can set a delegate on the speech synthesizer object and do some
    additional processing while text is being spoken.

    This works great when I start speaking the text using the text view's
    built in contextual menu. However, I'm noticing that the startSpeaking
    method is not being called when I use the system keyboard shortcut set
    in the Text to Speech system preferences.

    Would anyone be able to tell me what message is called on what object
    when that shortcut is used, or if the system is handling it entirely?
    I'd like to be able to override the command coming from there as well.

    Thanks,
    ~Phil
  • > Would anyone be able to tell me what message is called on what object
    > when that shortcut is used, or if the system is handling it entirely?
    > I'd like to be able to override the command coming from there as well.

      See "NSSpeechSynthesizer". Searching the API reference for "speak"
    revealed this as the most likely candidate. There aren't many methods
    and it looks fairly straightforward ...

      Since services work on the selected text of whatever control
    currently has focus, it's unlikely you'll be able to catch this
    without a hack. Both NSTextView and this service likely create a
    speech synthesizer with the default voice and hand it the selection
    (or in the case of NSTextView, the entire text if there is no
    selection) as a string to speak.

    --
    I.S.
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today