Joe Maller.com

AppleScript System Events Bug

Despite the number of people successfully using my iPhoto AppleScripts, I’ve had a troubling number of people report problems as well. These weren’t just little problems, the scripts completely failed to run.

I asked several of these people to run the scripts from Script Editor and send me the error message they got when the scripts failed. All but one of the problems happened during a call to the System Events background application. Most infuriating was the fact that I couldn’t reproduce the problem. Today I managed to recreate what I believe is the problem.

The script below is a test script which pounds on System Events then tries to detect and recover from System Events crashes.

UIcheck() System Events Test Script (UIcheck.zip, 4k)

Please download the script and post your results in the comments. I’m seeing a consistent 3-9% failure rate for System Events on my PowerBook.

This is public domain, use at your own risk, etc. Please post improvements if you have them.

Update: Please post your OS version alongside any results.

Update 2: More on the System Events AppleScript bugginess Including a new test script.


9 Responses to “AppleScript System Events Bug” Comments Feed for AppleScript System Events Bug

  • failed 4 of 108 times
    failed 0 of 100 times
    failed 8 of 108 times
    failed 1 of 102 times
    “can’t make into a true number”
    weird!

  • About the same numbers as above for me :

    0 for 100 times
    0 for 100 times
    1 for 102 times
    0 for 100 times
    0 for 100 times
    0 for 100 times
    2 for 104 times
    3 for 106 times

    etc…
    The iPhoto scripts won’t run at all.

    Also yesterday, when I tried running the script through Script editor, it kept telling me something like “Can’t set ‘class uien’ to ‘true’ : wrong permissions”. I re-downloaded the script today and it doesn’t happen anymore, but I have the System Events bug now…

    Keep up the good work, I can’t wait to use your scripts, as I took more than a thousand pics with the wrong time set!

    Cheers,
    Lazare

  • Failed 3 of 106 times
    Failed 1 of 102 times

    Hope that helps. I am running 10.4 on a powerbook with iPhoto 5, and the scripts don’t seem to do anything from the menu, so it sounds like this issue. I will gladly plop down my 6 bucks if this can work, I’ve got a month of photos one month off!
    thanks!
    tim

  • I just ran the test all morning and got these numbers:

    Failed 658 of 21316 times, 3.09%

    I filed a bug with Apple and will post that here later today.

  • Oops, sorry, forgot to mention OS version :
    OS X 10.4.2 on a Powerbook. iPhoto version 5.0.4. Everything is localized in french.

  • 1 for 102
    3 for 104
    28 for 134
    14 for 118
    Script Editor Crashed Report sent to Apple
    1 for 102
    0 for 100
    1 for 102
    10 for 120
    2 for 104
    2 for 104
    2 for 104

    About 5% failure overall.

    15″ Powerbook, OS X 10.4.2, iPhoto 5.0.4

    Ditto on the readiness to pay, and major need for these!
    Been using an external App to syncronize multiple people’s cameras from the same event prior to import, but need to fix some old ones before I figured out how to do that.

    Thanks for looking into this, and for the hard work!

  • Infuriating: Testing a few new tweaks and trying to further isolate and workaround the problem; two machines which previously failed are now running the original test script without errors. Basically none. error in 1000 runs.

    Why? I have no idea. Maybe it’s some of the workarounds from the new scripts cleaned out whatever was kludging up System Events?

    But the script still crashes almost instantly in 10.3.9, so at least that’s consistent.

    A bit more testing and I’ll post the revised test script.

  • Does not run once. Error message (when run from script editor):
    “System Events” hat einen Fehler erhalten: NSInternalScriptError
    (“System Events” received an error: NSInternalScriptError)
    in the line “if UI elements enabled is false then” in “on UIEnabled()”
    I use OS 10.4.2, iPhoto 5.0.4, both German versions on PowerMac G5.
    Keep up the great work!

  • Failed 2 times out of 102

Leave a Reply