All the above commands operate on the active document selection. You can override this behavior to target different text or selections using the following push/pop commands:
Push Target Selection object v1.3
This command sets the target of other macro formatting commands to the given selection(s) so subsequent formatting commands affect the text in those selections. This leaves the current actual document selection unchanged.
The given object can anything accepted by the Document object’s setSelection command, most likely a Selection object or any array thereof.
An example that prepares some large red text before inserting it:
$text = "Bopomofo"
$color = Color.red
$selection = TextSelection.new($text)
Push Target Selection $selection
Set Text Color $color
Set Font Size 24
Pop Target Selection
Type Attributed Text $text
The formatting commands between the push/pop affect the $text variable, instead of the frontmost document.
NOTE: normal menu based commands like “Bold” still affect the active document as normal.
Pop Target Selection v1.3
Removes the last pushed target selection or text, restoring the prior formatting target, which may be another pushed target or the active document.
Push Target Text text v1.3
Works just as Push Target Selection, allowing subsequent formatting commands to affect only the given text object.
Pop Target Text v1.3
Removes the last pushed target selection or text, restoring the prior formatting target, which may be another pushed target or the active document.
Previous Chapter Formatting Text |
<< index >> |
Next Chapter Indexing |