There's an AFTER_PLACE property for the textFrame event listener. That should give you what you're after.
Thanks for the comment.
I've actually already tried using the AFTER_PLACE property, but it didn't work. After researching why, I came across the info that BEFORE_PLACE and AFTER_PLACE is only for placed assets. Meaning the handler will only be called for assets that are placed (anything that shows up in the links panel)
Ok, I didn't know that (I'm not too familiar with event handlers). The only event I use sometimes is afterSelectionChanged. You could use it to check whether a text frame that's deselected has the same content as it did before it was selected. (afterSelectionChanged doesn't tell you whether a selection's content has changed, but whether the selection has changed. Just clicking in a frame is enough to trigger it.)
That could work in a general sense, but I'm afraid afterSelectionChanged
might be a bit too broad.
I specifically need to know if there is any altered or added text anywhere
in the document.
I'm aiming to set a boolean based on altered/added text, so if I listen for
more than just that (like any time a selection is altered, be it clicked,
moved, resized) then the accuracy of my script will be compromised.
Thanks for the suggestion though! I appreciate the help.
Maybe you could use the 'track changes' feature. It's a quick way of checking if any text was changed, though it won't tell you about formatting.
That's a good solution!
The only issue I'd face with that is that my users have direct control over whether or not the 'Track Changes' feature is enabled/disabled, so they could potentially compromise my script by turning it off. I don't think I'd be comfortable with a non-absolute script, so I'll have to go back to the drawing board to see if I can handle this without looking for text changes/additions.
tracking changes of one or several text frames would be a huge task.
If the user should not change anything, I would provide a PDF as asset and control perhaps only if it is cropped, resized, rotated and positioned at the wrong place, hidden or is none-printing.