RegexAndStuffLib Ver 1.0.3 Returns NSStrings

Continuing the discussion from RegexAndStuffLib Script Library:

@ShaneStanley, I am getting unexpected results in matches from RegexAndStuffLib.
Matches are returning NSStrings, which should be regular AppleScript strings, correct?


My script:

use AppleScript version "2.5" -- El Capitan (10.11) or later
use framework "Foundation" -- this may not be required
use scripting additions

use script "RegexAndStuffLib" version "1.0.3"

tell application "Microsoft Outlook"
  set selMsg to current messages
  set oMsg to item 1 of selMsg
  set subjectStr to subject of oMsg
  set bodyHTML to content of oMsg
  set the clipboard to bodyHTML
  ## Author:\h+([^<]+).+\R[^>]+>([^<]+)
  set reFind to "Author:\\h+([^<]+).+\\R[^>]+>([^<]+)"
  set reMatches to regex search once bodyHTML ¬
    search pattern reFind ¬
    match case true ¬
    capture groups {}
  tell reMatches
    set authorStr to item 2
    set articleTitleStr to item 3
  end tell
end tell

### Requires Keyboard Maestro 8.0.3+ ###

set kmInst to system attribute "KMINSTANCE"

tell application "Keyboard Maestro Engine"
  setvariable "Local__Author" instance kmInst to authorStr
  setvariable "Local__ArticleTitle" instance kmInst to articleTitleStr
end tell

This script worked fine until I upgraded to Ver 1.0.3.

The problem is that it’s returning an array rather than a list, hence the NSStrings. Only the regex search once command is affected, and only when multiple capture groups are specified. Version 1.0.4 fixes it, and can be downloaded now.