<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font face="Liberation Serif">Here is an intellectual exercise.
Let's imagine you want to play with a layout by swapping images
from one frame and another, maybe even frames on different pages.<br>
<br>
Here is a script that does just that. If you don't like what you
get, just run it again -- Undo seems to work, but AFAICT you have
to undo twice to reverse the effects of the script. Note that the
frames are not swapped, just the image content.<br>
<br>
Greg<br>
<br>
****script follows****<br>
<br>
#!/usr/bin/env python<br>
# -*- coding: utf-8 -*-<br>
<br>
<br>
"""<br>
<br>
© 2012 Gregory Pittman<br>
<br>
swapimage.py<br>
<br>
USAGE<br>
<br>
Select 2 image frames, no more, no less, both must be image
frames. Can be on different <br>
pages.<br>
<br>
Run the script, the images are swapped.<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>
scribus.setRedraw(False)<br>
<br>
if scribus.selectionCount() != 2:<br>
scribus.messageBox('Selection Count', "You must have 2 image
frames selected",<br>
scribus.ICON_WARNING, scribus.BUTTON_OK)<br>
sys.exit(2)<br>
<br>
frame1 = scribus.getSelectedObject(0)<br>
frame2 = scribus.getSelectedObject(1)<br>
<br>
ftype1 = scribus.getObjectType(frame1)<br>
ftype2 = scribus.getObjectType(frame2)<br>
if ((ftype1 != "ImageFrame") or (ftype2 != "ImageFrame")):<br>
scribus.messageBox('Object Type', "Both selected objects must
be image frames",<br>
scribus.ICON_WARNING, scribus.BUTTON_OK)<br>
sys.exit(2)<br>
<br>
filename1 = scribus.getImageFile(frame1)<br>
filename2 = scribus.getImageFile(frame2)<br>
<br>
scribus.loadImage(filename2, frame1)<br>
scribus.loadImage(filename1, frame2)<br>
<br>
scribus.setRedraw(True)<br>
<br>
<br>
</font>
</body>
</html>