AppleScripts work but flood Console with sandbox errors

Discussion in 'Mac Programming' started by Aeryn, Nov 22, 2013.

  1. Aeryn macrumors member

    Joined:
    Jul 24, 2009
    #1
    I fall under the "knows just enough to be dangerous" category with regards to AppleScript and, since I went straight from SL to Mavericks, I'm fairly ignorant of the specifics of sandboxing.

    I have some AppleScripts that run perfectly fine, both from AS Editor and via launchd, but they fill Console with "denying dispatch of event...because it is not entitled to send an AppleEvent to this process" errors. One script iterates through 1000+ files so it pretty much "resets" Consoles 4000 messages.

    If the scripts are working as expected, should I just ignore the Console clutter?
     
  2. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    Most of these are probably sandbox violations. If the scripts run OK, I suspect the target application(s) are set up to be scripted in this way through the entitlement mechanism, but whatever dispatch mechanism is trying to invoke them is using the non-sandbox-safe way first, failing (and recording an error in the console), falling back to the sandbox-safe way and succeeding, every time an event gets sent. If this hypothesis is indeed correct, then the messages you're seeing in Console.app are completely harmless, because they're caused by a bug in OS X itself.
     
  3. Aeryn thread starter macrumors member

    Joined:
    Jul 24, 2009
    #3
    Thanks, sounds like a plausible theory. :)

    I tinkered around yesterday and figured out what was causing some of the errors, using "(current date)" within a repeat loop. Setting that up as a variable outside the repeat eliminated half the Console warnings. The other warning is being triggered by a tell block reading data from a plist within a repeat loop...and tinkering with that is a bit beyond me. But I eliminated half the errors, I'll just ignore the other half.
     

Share This Page