I have seen similar posts, but not quite the same.
I am trying to do a test on the next character that exists after a found item using find/change.
I am sure it isn’t difficult, but I am not sure how to convert the object reference of the selected text into its character position in a word?
This is what I have thus far.
tell application "Adobe InDesign CS4"
activate
set find what of find text preferences to nothing
set change to of change text preferences to nothing
set find what of find text preferences to ".."
set FoundText to find text
repeat with anItem in FoundText
set selection to character 2 of anItem
set theLetter to object reference of selection
set theWord to word 1 of anItem
--Here I would like to try and select the next character in the word and test if it is a period. If it is not I would like to do something
set theCount to count of theLetter of theWord
display dialog theCount as string
end repeat
set find what of find text preferences to nothing
set change to of change text preferences to nothing
end tell