And here is a second macro that you can run on a document, and that will look for all such strings and index all of them in the way you describe.

# Index All Bible Verses with Book
$doc = Document.active
$refs = $doc.text.find @String|\<\d?[[:upper:]][[:lower:]]{1,4}\> (?:\d+\.\d+, )*(?:\d+\.\d+)|, 'Ea-i'

foreach $ref in $refs
  $refString = $ref.substring
  $refString.find @String|\<(?<book>\d?[[:upper:]][[:lower:]]{1,4}\>) (?<verseList>(?:\d+\.\d+, )*(?:\d+\.\d+))|, '¢E-i'
  $verses = $verseList.split(', ')
  $refLoc = $ref.location + $book.length + 1
  foreach $verse in $verses
    $sel = TextSelection.new $ref.text, Range.new($refLoc, $verse.length)
    $doc.setSelection $sel
    Add to Text Index As "$book $verse"
    $refLoc = $sel.bound + 2
  end
end

> On Jan 23, 2019, at 19:23 , takamitsu Muraoka <[log in to unmask]> wrote:
> 
> Dear friends,
> 
> I wonder if someone could help.
> When you have a series of references to a biblical book, for instance, with the name of the book first, then a series of references, I would like to use "Index as". E.g. 1Sam 3.4, 5.6, 7.8, 12.10. At the moment  for the the last three references, I first select "1Sam", copy it, then apply "Index a" to the last three references, by manually copying "1Sam" in front of the numbers. Sometimes, however, without me doing anything, when I press "Index as", "1Sam 5.6" appears in the window, and then I just press "Mark." Is there something I can do in order to spare myself this nuisance?
> 
> Best wishes,
> Takamitsu MURAOKA
> 村岡崇光

Philip Spaelti
[log in to unmask]