Skip to main content
Participating Frequently
November 14, 2016
Question

Event Listener for Text Frame Placement/Edits?

  • November 14, 2016
  • 1 reply
  • 2238 views

Hi All!

I'm looking for some way to tell my script that a text frame has been placed or edited, so I can take an action based on that.

All of the documentation I've read doesn't suggest any type of listener for text frames, but I'm hoping someone here can point me in the right direction!

Any suggestions?

Thanks!

This topic has been closed for replies.

1 reply

Braniac
November 14, 2016

There's an AFTER_PLACE property for the textFrame event listener. That should give you what you're after.

P.

Participating Frequently
November 14, 2016

Hey pkahrel!

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)

Braniac
November 15, 2016

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.)

P.