Acrobat Scripting Issue

I have an issue with Adobe Acrobat I wonder if anyone has come across. I am trying to do the following:

-Run a search on a very long PDF document
-Find “markers” text on the page (“**beginpacket:”)
-Set bookmarks at every page that has the marker
-Split PDF into separate files based on the markers.

For this project I am using:
-Acrobat Pro 10.1.9
-Mac OS X 10.9.5
-Script Debugger 5

First task to do is run a search for instances of this text:

tell application “Adobe Acrobat Pro”
set myString to “**beginpacket:”
set allBmks to find text document 1 string myString
end tell

When I run this, I encounter a very frustrating issue. That issue is outlined on this page:
https://forums.adobe.com/thread/589707

Basically, the search string in Acrobat ends up being gibberish characters. Has anyone come across this problem and a found a solution?

To keep my project moving, I have GUI scripted the search by activating the search menu item then setting keystrokes (yeah, crazy I know!). This is a lot of trouble to go through because the Acrobat AS command “find text” does not work as advertised.


set allChars to {“", "”, “b”, “e”, “g”, “i”, “n”, “p”, “a”, “c”, “k”, “e”, “t”, “:”, return}

tell application “System Events”
tell process “AdobeAcrobat”
tell menu bar 1
tell menu “Edit”
click menu item “Advanced Search”
end tell
end tell
end tell
end tell

tell application “System Events”
keystroke (ASCII character 8) – Deletes what might be in the current box
repeat with theItem in allChars
keystroke theItem – search term and return
end repeat
end tell