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.