Onetastic Macro Documentation >
>
>
MoveObject MoveObject
Moves of a given object from its current parent to a new parent. Moving an object is equivalent of creating a copy of the object via CopyObject and then removing the original object via RemoveObject. The passed in object parameter will point to the newly created copy after the function returns. Following types of objects can be moved: Page Outline Table Row Cell Paragraph Image EmbeddedFile Tag.
Syntax
void MoveObject(
Object parent,
Object object,
Numeric position)
Parameters
- Object parent
- Parent object to move the object under. The type of the source object must be one of the types that can be inserted under the parent object. See remarks for compatible types.
- Object object
- Object to move. A new object of the same type will be created and all the properties and any descendant objects will be copied over. After the function returns, this parameter will point to the new object. The moved object may have a different identifier or modified date as a result.
- Numeric position
- The position to move the object to. The value is a 0 based index for the child collection or -1 to move at the end.
RemarksFollowing types of objects can be created, copied, and moved via InsertObject, CopyObject,
and MoveObject functions. See descriptions of each function for specific conditions or differences in behavior:
Parent Object |
Child Object Types |
Remarks |
Notebook |
SectionGroup Section |
Sections and section groups must have unique names inside a notebook. Section groups
cannot be copied or moved. Sections cannot be moved. |
SectionGroup |
SectionGroup Section |
Sections and section groups must have unique names inside a section group. Section groups
cannot be copied, moved, or removed. Sections cannot be moved or removed. |
Section |
Page |
|
Page |
Outline Image EmbeddedFile |
To create a Title object under a page, simply access its "title" property. |
Outline |
Paragraph Table Image EmbeddedFile |
An outline must have at least one child object. |
Paragraph |
Text Tag |
Text objects can only be inserted at the beginning or end of a paragraph. Text objects cannot be moved or removed |
Table |
Row |
A table must have at least one row. |
Row |
Cell |
A row must have at least one cell. Every row in a table must have the same number of cells. |
Cell |
Paragraph Table Image EmbeddedFile |
A cell must have at least one child object. |
Image |
Tag |
Image must be a direct child of a page to insert tags. Images inside outlines cannot have tags. Insert the tag into the image's parent paragraph instead. |
EmbeddedFile |
Tag |
Embedded file must be a direct child of a page to insert tags. Embedded files inside outlines cannot have tags. Insert the tag into the embedded file's parent paragraph instead. |
|