title: Using Appkit and Python to hide mouse cursor on OSX
body: <p>I'm trying to script hiding the mouse cursor on OSX 10.9.  I have Chrome starting and going full screen for a kiosk and I'd like to periodically run a script to hide the cursor.</p>
  
  <p>Applescript no longer directly supports "call method" to call the objective C method, so I thought the simplest method would be to use AppKit from the provided python.</p>
  
  <p>It crashes:</p>
  
  <pre><code>$ python
  Python 2.7.5 (default, Mar  9 2014, 22:15:05) 
  [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import AppKit
  &gt;&gt;&gt; AppKit.NSCursor.hide()
  Assertion failed: (CGAtomicGet(&amp;is_initialized)), function CGSConnectionByID, file Services/Connection/CGSConnection.c, line 123.
  Abort trap: 6
  </code></pre>
  
  <p>I suspect there is a pre-requisite call I need to make to initialize <em>something</em>,  but I haven't found anything yet while digging through docs/google.</p>
  
  <p>What am I missing?</p>