Many years ago I wrote a program that did some analysis of Adobe InDesign documents that had been generated from a database using templates. I did this for Windows using Object Linking and Embedding (OLE). The code looks something like this:
myInDesign = new OLEObject("InDesign.Application")
myDocument = myInDesign.ActiveDocument
myStory = myDocument.TextFrames.Item(1).ParentStory
iPars = myStory.Paragraphs.Count
For i = 1 to iPars
If myStory.Paragraphs.Item(i).Characters.Count>1 then
firstChar = myStory.Paragraphs.Item(i).Characters.Item(1)
firstCharUnicode = Asc(firstChar.Contents)
...
The client now requires the same thing but on a Mac but I no idea what the OLE equivelent is on Macs. The usual suspects of AppleScript or JavaScript seem only to ‘tell’ the application and not get information from a document.
Can anyone point me in the right direction please?