[scribus] Python script for scribus

Roger hovergo at net-tech.com.au
Mon Dec 29 23:56:15 CET 2008


<snip>
>> I have been trying to get python script to past images and text into a 
>> page in order to automate some of the set up and page layout
>> I am just learning python and wrote the following .py script from my 
>> gleaning of the documentation but get an error message:
</snip  No point in keeping all the previous text.>

Thanks Greg
I changed to createImage and it works, now inserts text and image as required, 
however
The error message remains until I click OK then the inserting goes ahead.

Error message reads:
Traceback (most recent call last):
   File "<string>", line 8, in <module>
   File "/home/roger250/Scribus135/scripts/RM-Sample-header.py", line 51, in 
<module>
     main()
   File "/home/roger250/Scribus135/scripts/RM-Sample-header.py", line 43, in main
     scaleImage(1,1)
NoValidObjectError: Cannot use empty string for object name when there is no 
selection

	selectfile = fileDialog("Navigate to images directory and select to place on 
page", "*.*")
Hard coding /path/to/image.jpg returns the same error message and script fails.
Hard coding/path/to/folder into the above returns an empty dialog selector from 
which I can choose one directory only, it then fails with same error message.
My images are permanently in /Pictures/folder1/. not in a Scribus directory.


Image is inserted with:

		d = createImage(33, 20, 32, 32)
#       loadImage("filename" [, "name"])
#		  loadImage(selectfile,header)

		loadImage(selectfile,d)
		scaleImage(1,1)
ScaleImage does not work regardless of scale setting.
It inputs at 50 percent even though the image and image box are same dimensions.

I use the latest Scribus 135svn and Qt4.4.3  downloaded and installed a couple 
of days ago.
TIA
Roger




More information about the scribus mailing list