[scribus] Tables in 1.5.6svn - revised script (resend)

Gregory Pittman gpittman at iglou.com
Thu Jan 9 19:03:07 UTC 2020


Thanks to Jean Ghali, I found out the upgrouping command is unGroupObject(). He will fix the docs.
So here is the revised script. With this one, no need to Group and then Ungroup manually, just select all
the frames and run the script.

You still will see this problem with being unable to select the frames afterward, but the workaround is
the same - select the top rule, send it to the bottom level (actually I think any downward movement in the level
works). Then you can select individual "cells" again.

BTW, I tried to see if I could incorporate this level-changing in the script, but as far as I can tell, the command
moveSelectionToFront() or moveSelectionToBack() and these seem to have no effect.

Greg

PS: Jean tells me he changed the name of the command to unGroupObjects(), but he also kept unGroupObject() as a deprecated alias.

Always helps to add the script:
<<begin script>>
#!/usr/bin/env python
"""
topbottomrules.py

Select a number of objects.
Run this script. Top and bottom horizontal rules are
created.
Afterward, select the top rule. Using Properties send this to bottom level.
Now you should be able to select individual objects.

"""
import scribus


if (scribus.haveDoc()):
    scribus.setRedraw(False)
    framegroup = scribus.groupObjects()
    xpos,ypos = scribus.getPosition()
    width,height = scribus.getSize()
    topline = scribus.createLine(xpos,ypos,xpos+width, ypos)    
    bottomline = scribus.createLine(xpos, ypos+height, xpos+width, ypos+height)
    scribus.unGroupObject(framegroup)
    scribus.setRedraw(True)
    scribus.redrawAll()

else:
    scribus.messageBox('OOPS!','You need to have a document open',scribus.ICON_NONE,button1=scribus.BUTTON_OK)
    sys.exit(1)
<<end script>>



More information about the scribus mailing list