Subversion Repositories Scribus

Rev

Rev 23696 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23224 jghali 1
<html>
2
<head>
3
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
23691 jghali 4
        <title>Manipulating Objects</title>
23224 jghali 5
</head>
23696 jghali 6
<style>
7
@import "manual.css";
8
</style>
23224 jghali 9
<body>
23691 jghali 10
<h2>Manipulating Objects</h2>
23224 jghali 11
 
12
<dl>
13
 
14
<dt><a name="-combinePolygons"><strong>combinePolygons()</strong></a></dt>
15
<dd><code>combinePolygons()</code>
23691 jghali 16
<p>Combines two or more selected polygons.</p>
17
<p>May raise <a href="scripterapi.html#WrongFrameTypeError">WrongFrameTypeError</a>.</p></dd>
23224 jghali 18
 
19
<dt><a name="-copyObject"><strong>copyObject</strong>(...)</a></dt>
23691 jghali 20
<dd><code>copyObject(["name"]) -&gt; string</code>
24150 jghali 21
<p>Copies the specified object or first item of selection if "name" is not given.</p>
22
<p>Deprecated. Use copyObjects() instead.</p></dd>
23224 jghali 23
 
24150 jghali 24
<dt><a name="-copyObjects"><strong>copyObjects</strong>(...)</a></dt>
25
<dd><code>copyObjects(names)</code>
26
<p>Copies the specified objects or the current object selection if no item names are given.</p>
27
<p>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.</p></dd>
28
 
23224 jghali 29
<dt><a name="-duplicateObject"><strong>duplicateObject</strong>(...)</a></dt>
23691 jghali 30
<dd><code>duplicateObject(["name"]) -&gt; string</code>
24150 jghali 31
<p>Creates a duplicate of the specified object or of first item of selection if "name" is not given.</p>
32
<p>Returns name of new object.</p>
33
<p>Deprecated. Use duplicateObjects() instead.</p></dd>
23224 jghali 34
 
24150 jghali 35
<dt><a name="-duplicateObjects"><strong>duplicateObjects</strong>(...)</a></dt>
36
<dd><code>duplicateObjects(names) -&gt; list</code>
37
<p>Creates a duplicate of the specified objects or of the current selection if no names are given.</p>
38
<p>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.</p>
39
<p>Returns a list of the names of the newly created objects.</p></dd>
40
 
23687 jghali 41
<dt><a name="-getCharacterStyle"><strong>getCharacterStyle</strong></a>(...)</dt>
23691 jghali 42
<dd><code>getCharacterStyle(["name"])</code>
43
<p>Return name of character style applied to object named "name". If "name" is not given, the currently selected object is used.</p>
44
<p>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.</p>
45
<p>May raise <a href="scripterapi.html#WrongFrameTypeError">WrongFrameTypeError</a> if target frame is not a text frame.</p></dd>
23687 jghali 46
 
23686 jghali 47
<dt><a name="-getParagraphStyle"><strong>getParagraphStyle</strong></a>(...)</dt>
23691 jghali 48
<dd><code>getParagraphStyle(["name"])</code>
49
<p>Return name of paragraph style applied to object named "name". If "name" is not given, the currently selected object is used.</p>
50
<p>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.</p>
51
<p>May raise <a href="scripterapi.html#WrongFrameTypeError">WrongFrameTypeError</a> if target frame is not a text frame.</p></dd>
23224 jghali 52
 
23686 jghali 53
<dt><a name="-getStyle"><strong>getStyle</strong></a>(...)</dt>
23691 jghali 54
<dd><code>getStyle(["name"])</code>
55
<p>Deprecated. Use getParagraphStyle() instead.</p></dd>
23686 jghali 56
 
23691 jghali 57
<dt><a name="-getTextFlowMode"><strong>getTextFlowMode</strong></a>(...)</dt>
58
<dd><code>getTextFlowMode(["name"]) -&gt; integer</code>
59
<p>Return the current text flow mode used by item "name" as an integer. If "name" is not given, the currently selected object is used.</p>
60
<p>The function will return one of the following value:
61
<ul>
62
        <li>0 : text flow around frame is disabled</li>
63
        <li>1 : text flow around frame shape</li>
64
        <li>2 : text flow around frame bounding box</li>
65
        <li>3 : text flow around frame contour line</li>
66
        <li>4 : text flow around image clip path</li>
67
</ul>
68
</p></dd>
69
 
23224 jghali 70
<dt><a name="-groupObjects"><strong>groupObjects</strong></a>(...)</dt>
23691 jghali 71
<dd><code>groupObjects(list)</code>
72
<p>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.</p></dd>
23224 jghali 73
 
74
<dt><a name="-isLocked"><strong>isLocked</strong></a>(...)</dt>
23691 jghali 75
<dd><code>isLocked(["name"]) -&gt; bool</code>
76
<p>Returns true if is the object "name" locked.  If "name" is not given the currently selected item is used.</p></dd>
23224 jghali 77
 
78
<dt><a name="-lockObject"><strong>lockObject</strong></a>(...)</dt>
23691 jghali 79
<dd><code>lockObject(["name"]) -&gt; bool</code>
80
<p>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.</p></dd>
23224 jghali 81
 
82
<dt><a name="-moveObject"><strong>moveObject</strong></a>(...)</dt>
23691 jghali 83
<dd><code>moveObject(dx, dy [, "name"])</code>
84
<p>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.</p>
85
<p>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 <em>copyObject(...)</em>, followed by <em>pasteObject(...)</em>, and then finally <em>deleteObject(...)</em> to delete the original.</p></dd>
23224 jghali 86
 
87
<dt><a name="-moveObjectAbs"><strong>moveObjectAbs</strong></a>(...)</dt>
23691 jghali 88
<dd><code>moveObjectAbs(x, y [, "name"])</code>
24150 jghali 89
<p>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.</p></dd>
23224 jghali 90
 
23691 jghali 91
<dt><a name="-pasteObject"><strong>pasteObject</strong>(...)</a></dt>
24150 jghali 92
<dd><code>pasteObject() -&gt; string</code>
93
<p>Pastes an object from the clipboard. This will be used only or most sensibly following <em>copyObject(...)</em>, since otherwise there will likely be nothing in the clipboard to paste.</p>
94
<p>Returns the names of the newly created object in a comma separated string.</p>
95
<p>Deprecated. Use pasteObjects() instead.</p></dd>
23691 jghali 96
 
24150 jghali 97
<dt><a name="-pasteObjects"><strong>pasteObjects</strong>(...)</a></dt>
98
<dd><code>pasteObjects() -&gt; list</code>
99
<p>Pastes the content of clipboard to canvas. This will be used only or most sensibly following <em>copyObjects(...)</em>, since otherwise there will likely be nothing in the clipboard to paste.</p>
100
<p>Returns the names of the newly created object in a list.</p></dd>
101
 
23224 jghali 102
<dt><a name="-rotateObject"><strong>rotateObject</strong></a>(...)</dt>
23691 jghali 103
<dd><code>rotateObject(rot [, "name"])</code>
104
<p>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.</p></dd>
23224 jghali 105
 
106
<dt><a name="-rotateObjectAbs"><strong>rotateObjectAbs</strong></a>(...)</dt>
23691 jghali 107
<dd><code>rotateObjectAbs(rot [, "name"])</code>
108
<p>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.</p></dd>
23224 jghali 109
 
110
<dt><a name="-scaleGroup"><strong>scaleGroup</strong></a>(...)</dt>
23691 jghali 111
<dd><code>scaleGroup(factor [,"name"])</code>
112
<p>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.</p>
113
<p>May raise ValueError if an invalid scale factor is passed.</p></dd>
23224 jghali 114
 
115
<dt><a name="-setCharacterStyle"><strong>setCharacterStyle</strong></a>(...)</dt>
23691 jghali 116
<dd><code>setCharacterStyle("style" [, "name"])</code>
117
<p>Apply the named character "style" to the object named "name".</p>
118
<p>If object name is not provided, style is applied on current object selection.</p>
119
<p>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.</p>
120
<p>May raise <a href="scripterapi.html#WrongFrameTypeError">WrongFrameTypeError</a> if the target frame is not a text frame.</p>
121
<p>May raise <a href="scripterapi.html#NotFoundError">NotFoundError</a> if specified style name does not exist in current document.</p></dd>
23224 jghali 122
 
23686 jghali 123
<dt><a name="-setParagraphStyle"><strong>setParagraphStyle</strong></a>(...)</dt>
23691 jghali 124
<dd><code>setParagraphStyle("style" [, "name"])</code>
125
<p>Apply the named paragraph "style" to the object named "name".</p>
126
<p>If object name is not provided, style is applied on current object selection.</p>
127
<p>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.</p>
128
<p>May raise <a href="scripterapi.html#WrongFrameTypeError">WrongFrameTypeError</a> if the target frame is not a text frame.</p>
129
<p>May raise <a href="scripterapi.html#NotFoundError">NotFoundError</a> if specified style name does not exist in current document.</p></dd>
23686 jghali 130
 
23224 jghali 131
<dt><a name="-setScaleFrameToImage"><strong>setScaleFrameToImage</strong></a>(...)</dt>
23691 jghali 132
<dd><code>setScaleFrameToImage([name])</code>
133
<p>Set frame size on the selected or specified image frame to image size.</p>
134
<p>May raise <a href="scripterapi.html#WrongFrameTypeError">WrongFrameTypeError</a>.</p></dd>
23224 jghali 135
 
136
<dt><a name="-setScaleImageToFrame"><strong>setScaleImageToFrame</strong></a>(...)</dt>
23691 jghali 137
<dd><code>setScaleImageToFrame(scaletoframe, proportional=None, name=&lt;selection&gt;)</code>
138
<p>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.</p>
139
<p>May raise <a href="scripterapi.html#WrongFrameTypeError">WrongFrameTypeError</a>.</p></dd>
23224 jghali 140
 
141
<dt><a name="-setStyle"><strong>setStyle</strong></a>(...)</dt>
23691 jghali 142
<dd><code>setStyle("style" [, "name"])</code>
143
<p>Deprecated. Use setParagraphStyle() instead.</p></dd>
23224 jghali 144
 
23691 jghali 145
<dt><a name="-setTextFlowMode"><strong>setTextFlowMode</strong>(...)</a></dt>
146
<dd><code>setTextFlowMode("name" [, state])</code>
147
<p>Enables/disables "Text Flows Around Frame" feature for object "name".</p>
148
<p>Called with parameters string name and optional int "state" (0 &lt;= state &lt;= 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.</p></dd>
23690 jghali 149
 
23224 jghali 150
<dt><a name="-sizeObject"><strong>sizeObject</strong></a>(...)</dt>
23691 jghali 151
<dd><code>sizeObject(width, height [, "name"])</code>
152
<p>Resizes the object "name" to the given width and height. If "name" is not given the currently selected item is used.</p></dd>
23224 jghali 153
 
23438 jghali 154
<dt><a name="-unGroupObjects"><strong>unGroupObjects</strong></a>(...)</dt>
23691 jghali 155
<dd><code>unGroupObjects("name")</code>
156
<p>Destructs the group the object "name" belongs to. If "name" is not given the currently selected item is used.</p></dd>
23224 jghali 157
 
23691 jghali 158
<dt><a name="-textFlowMode"><strong>textFlowMode</strong>(...)</a></dt>
159
<dd><code>textFlowMode("name" [, state])</code>
160
<p>Deprecated. Use setTextFlowMode() instead.</p></dd>
23224 jghali 161
 
162
</dl>
163
</body>
164
</html>