Selecting Objects

deselectAll(...)
deselectAll()

Deselects all objects in the whole document.

getSelectedObject(...)
getSelectedObject([nr]) -> string

Returns the name of the selected object. "nr" if given indicates the number of the selected object, e.g. 0 means the first selected object, 1 means the second selected Object and so on.

moveSelectionToBack(...)
moveSelectionToBack()

Moves the current selection to the back.

moveSelectionToFront(...)
moveSelectionToFront()

Moves the current selection to the front.

selectionCount(...)
selectionCount() -> integer

Returns the number of selected objects.

selectObject(...)
selectObject("name")

Adds the object with the given "name" to the current selection.

Lots of scripter function use the concept of "currently selected item" if an object name is not provided. In the case of multiple selections, the currently selected item is always the first item in the selection. As a consequence if you are planning to use object "name" as the currently selected item for following operations and current selection is not empty, you should call deselectAll() before calling this function.

If what you wish to do is to paste a copy of the object to another page, you must first copyObject(), then pasteObject(). See Manipulating Objects.