No internet connection
  1. Home
  2. How to

Getting Script Error in Macro Even though it works: kAXErrorCannotComplete

By Steve @stevef
    2019-08-06 08:53:42.133Z

    I am not sure if this is a bug or something I am doing wrong. Going back to the clicking on the Cubase export window from the other thread, I am just texting with the normal mouse clicks for now. It works, but for some reason after it's finished, the SF icon stays blue for a few seconds, and then comes up with an error. Any idea why I am getting this?

    Here's the Macro:

    And here is an extract from the log:

    06.08.2019 09:47:12.72 [Backend]: Invoking regular command: user:cjymq6dpf0000cv10c1mpahrg:cjymq8wts000jcv10fzu0y3o5

    06.08.2019 09:47:12.72 [Backend]: >> Command: user:cjymq6dpf0000cv10c1mpahrg:cjymq8wts000jcv10fzu0y3o5

    06.08.2019 09:47:12.72 [Backend]: Sending event /commands/started with subject: ToAgent...

    06.08.2019 09:47:12.72 [BackendConnection]: Received msg from backend: { name: '/commands/started', args: { r: 1, e: 91 } }
    06.08.2019 09:47:12.80 [Backend]: Clicking with mouse here: 72, 28

    06.08.2019 09:47:12.88 [Backend]: Clicking with mouse here: 1136, 312

    06.08.2019 09:47:18.93 [Backend]: Logging unknown error in action (02) ClickButtonAction: kAXErrorCannotComplete

    06.08.2019 09:47:18.95 [Backend]: Script error at line 0
    Error invoking element.click
    SoundFlow.Shortcuts.AXUIElementException: kAXErrorCannotComplete
    at SoundFlow.Shortcuts.AXUIElement.DoAction(String) + 0x96
    at SoundFlow.Shortcuts.Automation.Actions.ClickButtonAction.d__11.MoveNext() + 0x8d
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x1c
    at sfbackend!+0xca03d6
    at SoundFlow.Shortcuts.Automation.AutoAction`1.d__20.MoveNext() + 0x263

    Sending event /commands/error with subject: ToAgent...

    06.08.2019 09:47:18.95 [Backend]: << Command: user:cjymq6dpf0000cv10c1mpahrg:cjymq8wts000jcv10fzu0y3o5
    Sending event /commands/completed with subject: ToAgent...

    06.08.2019 09:47:18.95 [BackendConnection]: Received msg from backend: { name: '/commands/error',
    args:
    { command: 'user:cjymq6dpf0000cv10c1mpahrg:cjymq8wts000jcv10fzu0y3o5',
    commandName: 'Open MP3 Tag Edit',
    error:
    'Script error at line 0\n Error invoking element.click\n SoundFlow.Shortcuts.AXUIElementException: kAXErrorCannotComplete\n at SoundFlow.Shortcuts.AXUIElement.DoAction(String) + 0x96\n at SoundFlow.Shortcuts.Automation.Actions.ClickButtonAction.d__11.MoveNext() + 0x8d\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + 0x1c\n at sfbackend!+0xca03d6\n at SoundFlow.Shortcuts.Automation.AutoAction`1.d__20.MoveNext() + 0x263\n\n' } }
    06.08.2019 09:47:18.95 [BackendConnection]: Received msg from backend: { name: '/commands/completed', args: { r: 0, e: 92 } }

    Solved in post #3, click to view
    • 2 replies
    1. This is a timeout error from the Accessibility API. I'm assuming the "Edit ID3 Tag" button opens another window right? Cubase apparently blocks its main thread or accessibility event handling while showing that modal window, which means it won't respond to our request to click the button until after that window has closed again. This was a typical way of programming in the old days.
      The workaround is to use the Async mode of the "Click UI Element" action. To get to that, click the Wheel.
      You may or may not also have to set the "On Error" to "Continue" to swallow any errors. But I would only do that if the "Async" mode doesn't work.

      1. SSteve @stevef
          2019-08-06 08:58:49.681Z

          Thanks, Async sorted it out!

          Reply1 LikeSolution