Jump to content


Photo

Scripting/Automation and Accordance


  • Please log in to reply
23 replies to this topic

#21 Daniel Semler

Daniel Semler

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 1,695 posts
  • Gender:Male
  • Accordance Version:11.x

Posted 30 January 2014 - 04:46 PM

Ah ok thanx Joe. I might also be misremembering regarding delay as there was also a CPU issue in delay in pre-Mav releases. Anyhow not to worry - w/a available.

 

Thx

D


Accordance Configurations :
 
Mac : 2009 27" iMac                 Windows : HP 4540s laptop
      Intel Core Duo                          Intel i5 Ivy Bridge
      12GB RAM                                8GB RAM
      Accordance 11.0.1                       Accordance 11.0.1
      OSX 10.9 (Mavericks)                    Win 7 Professional x64 SP1


#22 JakeFromRutgers

JakeFromRutgers

    Member

  • Active Members
  • Pip
  • 12 posts
  • Accordance Version:10.x

Posted 01 February 2014 - 03:55 PM

Hi Joe, thank you so much for your help. I'm running into a number of issues, so I made a video so that perhaps you can help. My goal is to compare the Hebrew Book of Ben Sira to the Hebrew Proverbs. I'm very confused as to what I'm supposed to be doing within Accordance to get the results I want: A Word document containing a Ben Sira verse followed by a Proverbs verse, with their matching words highlighted. I unfortunately can't use your script because I'm working in Windows, but that's fine, this should help both my understanding and anyone else's understanding if they read this post.

 

Video: 

 

I ran into a number of crazy things - issues with Accordance, issues with the interface, etc. Many of them are probably me misunderstanding what I'm trying to do. However, not all of them are, and I'd really like to get this running as soon as possible. I would really appreciate any help you can give me!



#23 Joe Weaks

Joe Weaks

    Platinum

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

Posted 02 February 2014 - 01:42 AM

Hi Jake,

 

I didn't know you were on a PC, so much of my effort was pointless. I need to learn to remember that I can no longer assume Accordance users are Mac users.

 

I watched the video. First order of business is to get the INFER and Search Back working for you manually, before then attempting the automation.

(To that end, it might have been good to post some of those 'how to get it to work' questions as a separate topic. Most forum users are ignoring this topic case it has a techy-geeky topic title they assume will be over their head. I've not used the INFER command a lot, so a broader set of eyes would help you.)

 

Let me say Jake, by watching your video, I can see you're doing a great job learning things, and already have a command of the program beyond many who've used it for much longer.

 

I'll try and address some of the INFER use probs and then move on to gameplay for automation, but some of what you showed it buggy behavior that I am guessing in just on the windows version, which I've never seen. Those problems selecting Hebrew that has English on the same line have always annoyed me (yes, I do read a bit of Hebrew).

 

When you run INFER, the resulting window can be configured to display each verse per line using menu item

/Display/Set Text Pane Display…

You can do the same for each result window.

 

Now, as for the Search Back command:

Just to clarify, you can run Search Back either on a selection of word(s), or on the verse. So when you saw me selecting just prior to or inside the verse, I was running a verse Search Back. When you run a Search Back on the verse, it opens a third tab and a fourth tab. It does this so it can isolate the selected verse and then search for that in Tab3, so that Tab4 can use it to run: [INFER 5 CEB 3] <AND> [CONTENTS CEB]

So, that tab is not 'useless'... it is a penultimate step in getting at tab4, when you are searching whole verses. Cause, when you search back for a whole verse, it simply runs an INFER command on that verse, and your original source text (as you can see in the search criteria in tab4.

 

Now, when you Search Back from a selected phrase (presumably the red highlighted results from your INFER search), it doesn't need that intermediate tab3, cause the search criteria to Search Back in that case is:  phrase I have selected <AND> [CONTENTS CEB]

You can see this behavior by only having your original 2 tabs open, and run Search Back from a selected phrase, and see that it will only open 1 tab. Note that if you had a tab3 AND tab4 opened up from previously Searching Back for a whole verse, that tab3 won't update or change while you do a phrase Search Back.

Note also that the phrase Search Back command will add a "[fuzzy 3]" in there, too, if a word in the phrase is not highlighted.

 

 

Understanding how all that works is vitally important for you to understand my forthcoming suggestion about how to achieve results programmatically. Because, you're going to need to overcome some of Accordance scriptablity limitations by massaging the source material elsewhere.

The real problem is there's no way to reliably select some text in the text pane of the Tab2, in order to then run Search Back on it. (I nearly achieved it by putting each verse on one line and shrinking it as much as possible to reduce the line wraps.  But, if you're wanting to run Search Back on just the red highlighted phrase, you are out of luck doing it within Accordance.

But... who cares. 

If you want to compile the results based on phrase, here's what I would suggest.

 

1. Set up your window with the 3 tabs... All Proverbs  |  Ben Sira INFER results  |  Proverbs Search Back Results

(Get the third tab by Searching Back for a selected phrase, not the verse reference.)

 

2. Copy the Ben Sira results from tab2 and paste it into a Word document.

 

3. Make note of the search criteria in the Proverbs search back tab3.  It'll be something like:

בְּ י֥וֹם צָרָ֗ה <AND> [CONTENTS All Proverbs]

(The English and Hebrew portions may be swapped in the browser window)
Leave this Tab3 Search back results in the front.
 

4. Go back to your Word document, that has the verses with highlighted phrases in Ben Sira. Use this document as your search_phrase source, instead of trying to pull it from tab 2 of Accordance. Use VBA to select the next bold or red phrase, then process it in Accordance, then paste results in another document.

Pseudo code would be something like:

 

search_phrase = result of VBA select next font.bold phrase

 

search_string = search_phrase + "<AND> [Contents All Proverbs]"

 

bring Accordance to the front

 

Tab # to highlight the search box

 

paste search_string # to place the search string

 

keystroke return # to initiate the search

 

keystroke Alt-Shift-Tab # to place cursor in the text pane

 

Select all

 

Copy

 

Bring results Word document to the front

 

Paste the result

 

Go to source Word document

 

Select the whole verse of the phrase you selected

 

Copy that verse

 

Go to result Word doc to paste it

 

Add your  "========" divider

 

return to your Word source document

 

Repeat

 

</end code flow>

 

I've done this type of culling a word document in VBA to pull phrases that are bold. 

What I don't know, and can't help with is how you are doing key macros in Accordance. Accordance for Windows has no COM bindings or anything, so I assume you're using a macro keyboard program.


Joe Weaks
The Macintosh Biblioblog

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

#24 Daniel Semler

Daniel Semler

    Platinum

  • Active Members
  • PipPipPipPipPip
  • 1,695 posts
  • Gender:Male
  • Accordance Version:11.x

Posted 02 February 2014 - 06:15 PM

Hey Jake,

 

  I've only just cracked the surface of this but I was looking into scripting Acc on win and I'm playing with AutoIt. I have done very little but I can get it to pop a specified workspace to the front and enter search text and execute a simple search with it.

 

Thx

D


Accordance Configurations :
 
Mac : 2009 27" iMac                 Windows : HP 4540s laptop
      Intel Core Duo                          Intel i5 Ivy Bridge
      12GB RAM                                8GB RAM
      Accordance 11.0.1                       Accordance 11.0.1
      OSX 10.9 (Mavericks)                    Win 7 Professional x64 SP1





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users