Q: Cursor disappears in screen recordings after typing into text field using Quartz-based scripts I'm seeking clarity on a problem I am encountering while building a semi-automated screencasting & video encoding pipeline. A solid technique for addressing it would be lovely as well :-)
The problem
The setup: a Quartz-based + Applescript library enacts a screencast script that triggers screenrecording in an application like Quicktime, interacts with a website, then afterwards exports the screenrecording to a target location. 
This pipeline works. With one exception: the mouse cursor disappears in the resulting screen recording after using either the Quartz-based library or Applescript to type into a text field. Note that when I watch the screencast acted out live, I see the mouse cursor the whole time. 
Restoring the cursor
I have found some techniques that restore the mouse cursor while the screencast is being enacted:


*

*Manually type something after the input text box loses focus (doesn't work programmatically)

*Switching to a different application via cmd-tab (works manually and programmatically via Applescript)

*Launching a new application with Applescript, but only if it comes to the foreground (the mechanism for why this works is probably the same as switching to a different application)

*Doing a right-click to trigger a context menu to appear. Can be done programmatically, and can be within the same application. 


My temporary workaround is to simply issue two quick cmd-tab commands via Applescript after every time that the script types text. This works alright, though it does leave some minor artifacts in the resulting screencast.  
Details of setup & experiments
A few more details about the technology I'm using here. 


*

*The machine is a 2013 MBP running Yosemite

*I have used two independent Quartz-based libraries for simulating user actions: osxautomation and cliclick, both of which exhibit the same issue. 

*I have used three different techniques for doing the screenrecoding: Quicktime, Camtasia, and ffmpeg (ffmpeg -f avfoundation -i "1:0" out.avi). These all probably use AV Foundation under the hood, though I'm not sure about that. 

*I have used Safari, Firefox, and Chrome as the target browser for the interactions


Any insights into what might be causing the problem and/or ideas for a better workaround would be appreciated!!
p.s. I'm not familiar with most of the technologies involved, like Quartz and AV Foundation, so my apologies in advance if my description is fundamentally flawed, or if I've tagged a technology that doesn't bear at all upon the problem.

A: I use this in one of my cocoa applications to hide the cursor.
[NSCursor setHiddenUntilMouseMoves:YES];

You might give it a try to see if it unhides the cursor by setting it to "NO" or maybe toggling first "YES" and then "NO". Maybe look into other NSCursor commands as well.
Hope it helps. Good luck.
