Since the release of Mac OS X 10.7 (Lion), there's been a bug with AppleScripts targeting the IndigoServer app. At first, we believed that it was because there were multiple copies of the IndigoServer.app (previous versions, etc). In Lion and Mt. Lion, finding and deleting any extra copies of the server app on all mounted volumes seemed to solve the issue.
That doesn't seem to be the case with Mavericks. We've spent several hours starting/restarting/stopping the server on the last Mavericks build (10.9.5) and there is no discernible pattern. Sometimes scripts fail and other times they don't. It does appear that restarting the server is triggering the bug - we've not seen scripts fail after working or work after failing without a server restart. We have seen several server stop/start combinations get it working again - but not always on the first try. For instance, 3 stop/start cycles of the server failed to get it working but after a 4th attempt it started working again.
The problem as we understand it appears to be a bug introduced in Lion (and exacerbated in Mavericks) where the OS gets confused when trying to target some applications from AppleScript. We do know that the problem is exacerbated by having multiple copies of the server installed (it rarely works in that case) but unfortunately it looks like subsequent releases of Mavericks (and likely Yosemite as well) have made the problem worse, not better.
Here's more specifics after we started meticulously documenting our testing: in our testing, it never took more than two server restarts to trigger the bug (scripts stopped working) and, in fact, it mostly only took a single restart. The good news is that we could always get it working again by stopping/starting the server. On average, it took 2.2 stop/start combinations to get it working and Mac reboots didn't appear to make any difference. The most stop/restart attempts we saw was 5. Of course, because we don't know/understand this bug more, your experience may be different.
So - bottom line: if you see this error first make sure you have no other copies of the IndigoServer.app on any mounted hard drive. This would likely be because you have previous versions still installed, so look in these locations:
/Library/Application Support/Perceptive Automation/Indigo 7/
/Library/Application Support/Perceptive Automation/Indigo 6/
/Library/Application Support/Perceptive Automation/Indigo 5/
/Library/Application Support/Perceptive Automation/Indigo 4/
/Library/Application Support/Perceptive Automation/Indigo 2/
Note: those are in the Library folder at the top-level of your hard drive, not the one in your home directory. In the Finder, select the Go->Go To Folder... menu item and paste in each one and it'll open a window to that folder. Just delete the IndigoServer.app file (not just move it to the trash, but also empty the trash so it's really deleted).
Once you've done that, if you're still seeing the issue just repeat these steps until it's working again:
- Select Indigo 7.2->Stop Server
- On the Server Connection Status dialog, click the Start Local Server... button
- On the Start Local Server dialog, click the Start Server button
- Once the server is up, run a test script that talks to the IndigoServer
Hopefully it will start working after only a couple of attempts.