## Manipulating Objects

combinePolygons()
  `combinePolygons()`

  Combines two or more selected polygons.

  May raise WrongFrameTypeError.

copyObject(...)
  `copyObject(["name"]) -> string`

  Copies the specified object or first item of selection if "name" is not given.

  Deprecated. Use copyObjects() instead.

copyObjects(...)
  `copyObjects(names)`

  Copies the specified objects or the current object selection if no item names are given.

  The names of objects to copy can be provided as a string to copy a single object or as a list of strings to copy several objects at once.

duplicateObject(...)
  `duplicateObject(["name"]) -> string`

  Creates a duplicate of the specified object or of first item of selection if "name" is not given.

  Returns name of new object.

  Deprecated. Use duplicateObjects() instead.

duplicateObjects(...)
  `duplicateObjects(names) -> list`

  Creates a duplicate of the specified objects or of the current selection if no names are given.

  The names of objects to duplicate can be provided as a string to duplicate a single object or as a list of strings to duplicate several objects at once.

  Returns a list of the names of the newly created objects.

getCharacterStyle(...)
  `getCharacterStyle(["name"])`

  Return name of character style applied to object named "name". If "name" is not given, the currently selected object is used.

  If current object has a text selection, the name of style applied to start of selection is returned. Otherwise the name of the item default character style is returned.

  May raise WrongFrameTypeError if target frame is not a text frame.

getParagraphStyle(...)
  `getParagraphStyle(["name"])`

  Return name of paragraph style applied to object named "name". If "name" is not given, the currently selected object is used.

  If current object has a text selection, the name of style applied to start of selection is returned. Otherwise the name of the item default style is returned.

  May raise WrongFrameTypeError if target frame is not a text frame.

getStyle(...)
  `getStyle(["name"])`

  Deprecated. Use getParagraphStyle() instead.

getTextFlowMode(...)
  `getTextFlowMode(["name"]) -> integer`

  Return the current text flow mode used by item "name" as an integer. If "name" is not given, the currently selected object is used.

  The function will return one of the following value:

  - 0 : text flow around frame is disabled
  - 1 : text flow around frame shape
  - 2 : text flow around frame bounding box
  - 3 : text flow around frame contour line
  - 4 : text flow around image clip path
groupObjects(...)
  `groupObjects(list)`

  Groups the objects named in "list" together. "list" must contain the names of the objects to be grouped. If "list" is not given the currently selected items are used.

isLocked(...)
  `isLocked(["name"]) -> bool`

  Returns true if is the object "name" locked. If "name" is not given the currently selected item is used.

lockObject(...)
  `lockObject(["name"]) -> bool`

  Locks the object "name" if it's unlocked or unlock it if it's locked. If "name" is not given the currently selected item is used. Returns true if locked.

moveObject(...)
  `moveObject(dx, dy [, "name"])`

  Moves the object "name" by dx and dy relative to its current position. The distances are expressed in the current measurement unit of the document (see UNIT constants). If "name" is not given the currently selected item is used. If the object "name" belongs to a group, the whole group is moved.

  If what you wish to do is to move an object to a different page or layer, it may be more efficient to do the sequence copyObject(...), followed by pasteObject(...), and then finally deleteObject(...) to delete the original.

moveObjectAbs(...)
  `moveObjectAbs(x, y [, "name"])`

  Moves the object "name" to a new location. The coordinates are expressed in the current measurement unit of the document (see UNIT constants). If "name" is not given the currently selected item is used. If the object "name" belongs to a group, the whole group is moved.

pasteObject(...)
  `pasteObject() -> string`

  Pastes an object from the clipboard. This will be used only or most sensibly following copyObject(...), since otherwise there will likely be nothing in the clipboard to paste.

  Returns the names of the newly created object in a comma separated string.

  Deprecated. Use pasteObjects() instead.

pasteObjects(...)
  `pasteObjects() -> list`

  Pastes the content of clipboard to canvas. This will be used only or most sensibly following copyObjects(...), since otherwise there will likely be nothing in the clipboard to paste.

  Returns the names of the newly created object in a list.

rotateObject(...)
  `rotateObject(rot [, "name"])`

  Rotates the object "name" by "rot" degrees relatively. The object is rotated by the vertex that is currently selected as the rotation point - by default, the top left vertext at zero rotation. Positive values mean counter clockwise rotation when the default rotation point is used. If "name" is not given the currently selected item is used.

rotateObjectAbs(...)
  `rotateObjectAbs(rot [, "name"])`

  Sets the rotation of the object "name" to "rot". Positive values mean counter clockwise rotation. If "name" is not given the currently selected item is used.

scaleGroup(...)
  `scaleGroup(factor [,"name"])`

  Scales the group the object "name" belongs to. Values greater than 1 enlarge the group, values smaller than 1 make the group smaller e.g a value of 0.5 scales the group to 50 % of its original size, a value of 1.5 scales the group to 150 % of its original size. The value for "factor" must be greater than 0. If "name" is not given the currently selected item is used.

  May raise ValueError if an invalid scale factor is passed.

setCharacterStyle(...)
  `setCharacterStyle("style" [, "name"])`

  Apply the named character "style" to the object named "name".

  If object name is not provided, style is applied on current object selection.

  If multiple objects are selected or if selected object has no text selection, style is applied on selected object(s). Otherwise style is applied to the current text selection.

  May raise WrongFrameTypeError if the target frame is not a text frame.

  May raise NotFoundError if specified style name does not exist in current document.

setParagraphStyle(...)
  `setParagraphStyle("style" [, "name"])`

  Apply the named paragraph "style" to the object named "name".

  If object name is not provided, style is applied on current object selection.

  If multiple objects are selected or if selected object has no text selection, style is applied on selected object(s). Otherwise style is applied to the current text selection.

  May raise WrongFrameTypeError if the target frame is not a text frame.

  May raise NotFoundError if specified style name does not exist in current document.

setScaleFrameToImage(...)
  `setScaleFrameToImage([name])`

  Set frame size on the selected or specified image frame to image size.

  May raise WrongFrameTypeError.

setScaleImageToFrame(...)
  `setScaleImageToFrame(scaletoframe, proportional=None, name=<selection>)`

  Sets the scale to frame on the selected or specified image frame to `scaletoframe'. If `proportional' is specified, set fixed aspect ratio scaling to `proportional'. Both `scaletoframe' and `proportional' are boolean.

  May raise WrongFrameTypeError.

setStyle(...)
  `setStyle("style" [, "name"])`

  Deprecated. Use setParagraphStyle() instead.

setTextFlowMode(...)
  `setTextFlowMode("name" [, state])`

  Enables/disables "Text Flows Around Frame" feature for object "name".

  Called with parameters string name and optional int "state" (0 <= state <= 3). Setting "state" to 0 will disable text flow. Setting "state" to 1 will make text flow around object frame. Setting "state" to 2 will make text flow around bounding box. Setting "state" to 3 will make text flow around contour line. If "state" is not passed, text flow is toggled.

sizeObject(...)
  `sizeObject(width, height [, "name"])`

  Resizes the object "name" to the given width and height. If "name" is not given the currently selected item is used.

unGroupObjects(...)
  `unGroupObjects("name")`

  Destructs the group the object "name" belongs to. If "name" is not given the currently selected item is used.

textFlowMode(...)
  `textFlowMode("name" [, state])`

  Deprecated. Use setTextFlowMode() instead.