<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Liberation Serif">Here is a simple script I wrote to a
simple task: resize an object, width and height, by a specified
amount.<br>
The default is 0.5, but you can do multiples, like 2.37<br>
<br>
Seems to work on a variety of objects, including vector images,
shapes, Bezier curves, arcs. It worked with a spiral, but had a
redraw issue...?<br>
<br>
Here it is:<br>
<br>
****script follows********<br>
<br>
#!/usr/bin/env python<br>
# -*- coding: utf-8 -*-<br>
#resizeobject.py<br>
<br>
#
****************************************************************************<br>
# This program is free software; you can redistribute it and/or
modify <br>
# it under the terms of the GNU General Public License as
published by<br>
# the Free Software Foundation; either version 2 of the License,
or<br>
# (at your option) any later version.<br>
#<br>
# This program is distributed in the hope that it will be useful,<br>
# but WITHOUT ANY WARRANTY; without even the implied warranty of<br>
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the<br>
# GNU General Public License for more details.<br>
#<br>
# You should have received a copy of the GNU General Public
License<br>
# along with this program; if not, write to the Free Software<br>
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.<br>
# <br>
#
****************************************************************************<br>
<br>
<br>
"""<br>
<br>
© 2012 by Gregory Pittman<br>
<br>
Select an object, start script.<br>
<br>
Enter a value to shrink/enlarge by, click Ok.<br>
<br>
<br>
<br>
"""<br>
<br>
try:<br>
import scribus<br>
except ImportError:<br>
print "Unable to import the 'scribus' module. This script will
only run within"<br>
print "the Python interpreter embedded in Scribus. Try
Script->Execute Script."<br>
sys.exit(1)<br>
<br>
if not scribus.haveDoc():<br>
scribus.messageBox('Scribus - Script Error', "No document
open", scribus.ICON_WARNING, scribus.BUTTON_OK)<br>
sys.exit(1)<br>
<br>
if scribus.selectionCount() == 0:<br>
scribus.messageBox('Scribus - Script Error',<br>
"There is no object selected.\nPlease select a text
frame and try again.",<br>
scribus.ICON_WARNING, scribus.BUTTON_OK)<br>
sys.exit(2)<br>
if scribus.selectionCount() > 1:<br>
scribus.messageBox('Scribus - Script Error',<br>
"You have more than one object selected.\nPlease
select one text frame and try again.",<br>
scribus.ICON_WARNING, scribus.BUTTON_OK)<br>
sys.exit(2)<br>
selected_frame = scribus.getSelectedObject()<br>
pageitems = scribus.getPageItems()<br>
scribus.setRedraw(False)<br>
<br>
dimensions = scribus.getSize(selected_frame) # (width, height)<br>
factor = scribus.valueDialog("Resize Object", "Resize by multiple
or decimal fraction", "0.5")<br>
factor = float(factor)<br>
newwidth = dimensions[0]*factor<br>
newheight = dimensions[1]*factor<br>
scribus.sizeObject(newwidth, newheight)<br>
<br>
scribus.setRedraw(True)<br>
scribus.redrawAll()<br>
<br>
<br>
</font>
</body>
</html>