Retrieving The Current Selection - Adobe GoLive CS2 Programmer's Manual

Hide thumbs Also See for GoLive CS2:
Table of Contents

Advertisement

SDK Programmer's Guide
part
full
complex
Additional properties of the selection object provide access to the selected elements:
element
box
start
length
text
range

Retrieving the current selection

Use the properties of the selection object to retrieve the current user selection in the active document.
For example, suppose a text element has the content This is a fine product , and the user selects
the word is . The properties of the selection object would provide the following information:
Property
element
type
start
length
text
box
When the selection is not text, the document.selection.text property holds the markup source text
that defines the selection. For example, clicking an image in the active GoLive document would produce
selection data like this:
A portion of the current markup element is selected, such as when only part of a text
element is selected.
An entire markup element is selected, such as when the user clicks an image box.
More than one markup element is selected or partially selected.
The first selected element. Assign a markup object to this property to select its
corresponding element. Assigning anything other than a markup object discards the
current selection.
When the selection is a custom element, contains the
element's visual representation in Layout view.
Offset from the outer delimiters of the first selected tag to the first character of source code
in the selection.
Number of ASCII characters that define the selection in its associated markup source code.
The selected text, according to the current values of the
An object that represents the selection range independently of the current document
selection. You can keep a copy of the
it to this property to make it the current selection again. See
Value
Description
The markup object that holds selection represents a
text
document's source code.
Only part of the element is selected.
part
Selection begins at offset position 5.
5
Selection is two characters in length.
2
The selected characters.
is
The
object is not available for this element.
null
box
Adobe GoLive CS2 SDK
object, operate on it independently, and restore
range
Editing Documents Programmatically
object that manages this
box
and
properties.
start
length
Using the range
element in the
text
101
object.

Advertisement

Table of Contents
loading

Table of Contents