Jump to content

Automator: Invalid verse reference causes Accordance to show a dialog


Darin Franklin

Recommended Posts

If I request an invalid verse reference through Automator, then Accordance plays an alert sound and shows an OK dialog with an error message. I must dismiss this error in Accordance before Accordance replies to the script in the Automator workflow.

 

Set up a workflow.

1. Get Specified Text: Matt 1:1

2. Get Text from Accordance: HMT-W4

 

Run it. The workflow blocks while Accordance displays a dialog, "The book 'Matt' cannot be found.". After I click OK on that, then Automator receives the script error.

 

The same thing happens if I use Applescript directly.

 

tell application "Accordance" to set theResult to «event AccdTxRf» {"HMT-W4", "Matt 1:1", false}

 

Instead, the script should receive the error directly without any prompts to the user.

Link to comment
Share on other sites

This has been the case since the initial release of the widget. I have previously mentioned the problem before, that it is bad form for a result from an apple event call (error or otherwise) to engage a routine that involves the app's ui. It should simply return an empty string IMHO, or something like "**Not found**".

Link to comment
Share on other sites

The script does actually get a useful error message, but not until I click OK in Accordance.

try
    tell application "Accordance" to set theResult to «event AccdTxRf» {"GNT-T", "Gen 1:1", false}
on error errMsg number errNum
    log ("errMsg=" & errMsg & "; errNum=" & errNum)
end try

Result:

tell application "Accordance"
    «event AccdTxRf» {"GNT-T", "Gen 1:1", false}
        --> error number -1
end tell
(*errMsg=Accordance got an error: An error of type -1 has occurred.; errNum=-1*)

The reason I'm selecting an invalid verse is to determine whether a module contains Hebrew or Greek. I fetch "Gen 1:1", and if that was not found, "Matt 1:1". This works for modules with OT, because I get Gen 1:1 first, but for modules with NT only, it fails and blocks my script.

Link to comment
Share on other sites

Right.

There is a call that checks if a module is in English or not, but not one to see if in Greek or Hebrew.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...