Jump to content


Photo

Automator: Invalid verse reference causes Accordance to show a dialog


  • Please log in to reply
3 replies to this topic

#1 Darin Franklin

Darin Franklin

    Bronze

  • Active Members
  • PipPip
  • 61 posts
  • Gender:Male
  • Accordance Version:11.x
  • Platforms:Mac OS X

Posted 19 August 2014 - 10:00 PM

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.



#2 Joe Weaks

Joe Weaks

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 1,085 posts
  • Gender:Male
  • Location:Odessa, TX
  • Interests:I like things that are Orange, and possibly Blue.
  • Accordance Version:11.x

Posted 20 August 2014 - 12:22 AM

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**".


Joe Weaks
The Macintosh Biblioblog

Sometimes I'm so helpful even I can't stand it.

#3 Darin Franklin

Darin Franklin

    Bronze

  • Active Members
  • PipPip
  • 61 posts
  • Gender:Male
  • Accordance Version:11.x
  • Platforms:Mac OS X

Posted 20 August 2014 - 11:22 AM

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.



#4 Joe Weaks

Joe Weaks

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 1,085 posts
  • Gender:Male
  • Location:Odessa, TX
  • Interests:I like things that are Orange, and possibly Blue.
  • Accordance Version:11.x

Posted 20 August 2014 - 03:19 PM

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.


Joe Weaks
The Macintosh Biblioblog

Sometimes I'm so helpful even I can't stand it.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users