Text Objects - Overview

The Text Object functions allow you to use a script to manipulate Text objects on a page in your publication. For example, you can use the OpusScript functions listed below to create a hypertext link on a piece of text in a Text object or to play an Autonarration for a Text object.

Hierarchy:

As well as the specific functions listed under the Functions: heading below, you can also use the following OpusScript functions:

image\Script_Button.jpgGraphical Object functions

image\Script_Button.jpgBasic Object functions

Class Hierarchy:

Text Objects

image\Hierarchy_Level.jpg Graphical Objects

 image\Hierarchy_Level.jpg Basic Objects

Hierarchy of objects in Opus

Functions:

CharFromPoint

Get the character at a given position

CreateHypertext

Create a hypertext link and action for a selection

FindText

Find a string of text in a specified Text object

FindTextInSelection

Find a string of text only in the selected part of a Text object

GetFirstHypertext

Get the first hypertext link in a specified text object

GetLineCount

Get the number of lines

GetNextHypertext

Get the next hypertext link in a specified text object

GetNumberHypertext

Get the total number of links in a specified text object

GetParagraphCount

Get the number of paragraphs in a Text object

GetSelection

Gets the position of the selected characters

GetSelectionParagraphStyle

Get the paragraph style of selected text

GetSelectionStyle

Get the formatting style of selected text

GetSelectionText

Gets the selected text as a string

GetText

Get a string containing the text in the hyperlink

GetTextLength

Get the number of characters

GetWordCount

Get the number of words

IsAutonarratePlaying

Check if an autonarrate is currently playing

LineFromChar

Get the line index of a character position

LineIndex

Get the character index of the first character in a line

LineLength

Get the number of characters in a line

ParagraphIndex

Return the index number of a paragraph in a Text object

ParagraphLength

Return the number of characters in a paragraph

PlayAutonarrate

Begin the autonarration on this text

PointFromChar

Get the position of a character

RemoveAllHypertext

Remove all hypertext links for this text

ReplaceSelection

Replaces the current selection with a specified string

Scroll

Scroll the text by line, paragraph or page

SetColour

Set the colour of the text

SetListBoxSelection

Set the highlighted area in a Listbox object to a new line

SetSelection

Selects a range of characters in the text object

SetSelectionParagraphStyle

Set the paragraph style of selected text

SetSelectionStyle

Set the formatting style of selected text

StopAutonarrate

End the autonarration on this text