Message Board for Rorohiko Workflow Resources
https://www.rorohiko.com/cgi-bin/yabb2/YaBB.pl
Documentation >> API Documentation (APIDToolAssistant) >> Story Events (version >= 1.0.46)
https://www.rorohiko.com/cgi-bin/yabb2/YaBB.pl?num=1224128161

Message started by Kris Coppieters on 10/16/08 at 15:36:01

Title: Story Events (version >= 1.0.46)
Post by Kris Coppieters on 10/16/08 at 15:36:01
From version 1.0.46 onwards, story objects play a more important role, and they receive more events. It also has become possible to edit the attached script for stories with the Active Page Item Developer palette.

The change is in how APIDToolAssistant reacts when a text frame is selected.

If the text frame is selected with the regular selection tool, then you'll be accessing the text frame's API properties. However, if you click inside the text frame with the text selection tool, the Active Page Item Developer will instead show the API properties of the story that runs 'through' that text frame.

Stories now also receive selected and deselected events - in previous versions there was a 'hole' in the way APIDToolAssistant was tracking selections: as soon as the user made a text selection, your script would lose track because no more selected/deselected events would occur until the user selected another page item and left the text selection mode.

That's now been remedied - when the user goes 'into' text selection mode, your story object will receive a 'selected' event (and any observer will receive a 'subjectSelected' event).

When the user leaves text selection mode, your story will receive a 'deselected' event.

When the text selection changes or moves, your story will receive a 'selected-textselection' event.

With this change it now becomes easy to create an observer that continuously tracks the current selection  - simply set your event filter to 'subject*elected*' and it will receive subjectSelected, subjectDeselected, and subjectSelected-textselection events - i.e. every time the selection changes, you'll get an event.

You could then do things like continuously update a ScriptUI palette: your event handler would check the app.selection and update a ScriptUI palette accordingly.

Stories now also receive all other text-based events - so to handle text changes and so you can 'attach' yourself to the stories instead of to the text frames as was necessary in previous versions.

Message Board for Rorohiko Workflow Resources » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2024. All Rights Reserved.