Xcode Cocoa-Applescript Dictation Program Primer Tutorial

Xcode Cocoa-Applescript Dictation Program Primer Tutorial

Xcode Cocoa-Applescript Dictation Program Primer Tutorial

Building on yesterday’s relevant Mac OS X Dictation Primer Tutorial as shown below, which addressed the Operating System view of the Dictation functionality, today we take some first steps down the road of writing an application to use this Dictation functionality.

We make use of the Xcode IDE and create a new project which is a Cocoa-Applescript Application project, and as you may have guessed from this we also make use of Mac Applescript Editor application to unit test what we place into the application in the “slot” where you place your Applescript script code.

The first slides of our tutorial address the System Preferences Privacy and Security issues associated with allowing access of software to the Dictation system (read more here), and with Mac OS X 10.9 (Mavericks) this has tightened up quite a bit (rather than the one checkbox as for previous Mac OS Xs, for Mavericks we, as administration users, need to specify individual applications given access to the functionality).

Then we see the Xcode IDE File->New Project … Cocoa-Applescript Application creation of an Xcode application, which is added to our System Preference Dictation “allow” list.

Here is some downloadable Applescript script called AppDelegate.applescript (for this we need to thank brilliance of Open Source community on this link) supervised by some Objective-C programming source code called main.m

There are, as you might expect, means to functionality, to do away with all mouse and keyboard aspects to this Dictation functionality.


Did you know? … or … By the way

The little “Eat at Joes” bizzo with the tutorial picture today is an example of Javascript embedded into the blog post as featured at Javascript Thumbnails in Your WordPress Post Primer Tutorial, and involved:

  • Giving the image an id (don’t we all crave for this) … made it “xcimage”
  • Embedded into the blog post
    <script type=’text/javascript’>var xcimageo = null; setInterval(eatAtJoes, 3000); function eatAtJoes() { if (xcimageo == null) xcimageo = document.getElementById(‘xcimage’); xcimageo.src = xcimageo.src.replace(“-51″, “~52″).replace(“-52″, “-51″).replace(“~”,”-“); } </script>
  • If this embedding feels odd to you, that is a natural enough reaction, but bear in mind that (Javascript) Bookmarklets all work in this similar vein … refer to this link perhaps.

    Another approach to this “look” are animated GIFs, and for this would recommend Gifpal and you can catch up on some tutorials about Gifpal here.


    Previous relevant Mac OS X Dictation Primer Tutorial is shown below.

    Mac OS X Dictation Primer Tutorial

    Mac OS X Dictation Primer Tutorial

    The ability to use Dictation to text boxes using Mac OS X has been around awhile, but the means to demonstrate this for you in a tutorial got harder with Mac OS X Mavericks with the demise of an integrated Podcast Publisher to show you both the audio and the video together, easily, in a presentation.

    First off, let’s say how great Dictation is, with the incredible functionality of interpreting what you say getting sent to and from an Apple server (via voice recognition functionality) and onto a text box within a Mac application like Notes, as we show you here today … just incredible.

    Showing you … well … that needed …

    • Two passes with Quicktime Player, first laying down a Video track of Dictation, then secondly synchronizing an Audio track of Dictation later (while playing the Video track) … doesn’t seem to be able to let you record both at once, though tried this, to find corrupt data when trying to save them.
    • One pass at the brilliant VLC Media Player (home page) via File->Advanced Open File… opening video plus synchronized audio with Streaming/Saving checked to a *.m4v encapsulation method MPEG 4
    • Dictation involved opening Mac OS X Notes application and having the cursor ready at the top of a new note and then sets of pressing fn-fn (ie. function key twice … this is configurable with System Preferences) to show the microphone, dictating your piece, then clicking Done (remarkably this goes to an Apple server and back, but there is no big delay).

    As you view the tutorial would like to apologize if you can’t hear it clearly … figure you can divide the world into those who like to record and those who’d prefer to do this work in a dark cupboard … hope not too many elephants fall into this latter category?! Anyway, the last point above could help clarify what was going on in the tutorial.

    This functionality can help some users who find typing at the keyboard difficult, and for those who like the kinesthetic approach of talking and thinking on their feet, perhaps. Imagine there are many other uses, and users for these uses, out there.

    If this was interesting you may be interested in this too.


    If this was interesting you may be interested in this too.

This entry was posted in eLearning, Operating System, Software, Tutorials, Xcode and tagged , , , , , , , , , , , , , , . Bookmark the permalink.

2 Responses to Xcode Cocoa-Applescript Dictation Program Primer Tutorial

  1. I want to convey my love for your kindness in support of visitors who must have help on this particular area of interest. Your special dedication to passing the message along was astonishingly invaluable and have continually enabled women like me to realize their ambitions. Your amazing warm and helpful help and advice implies so much to me and far more to my colleagues. With thanks; from everyone of us.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>