Last active
October 27, 2018 12:52
-
-
Save aldoridhoni/6cfdf3cc233b737d1f3a473c1220a816 to your computer and use it in GitHub Desktop.
Scribus script for looping all textbox and created number for doorprize.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
page = 1 | |
pagenum = scribus.pageCount() | |
content = [] | |
number = 0 | |
copies = 2 ### how many times number are displayed | |
current_pos = 1 | |
while (page <= pagenum): | |
scribus.gotoPage(page) | |
d = scribus.getPageItems() | |
for item in d: | |
if (item[1] == 4): | |
# contents = scribus.getAllText(item[0]) | |
scribus.deleteText(item[0]) | |
scribus.insertText('{num:03d}'.format(num=number), 0, item[0]) ### start with 000 | |
scribus.setFontSize(30, item[0]) | |
scribus.setTextAlignment(scribus.ALIGN_CENTERED, item[0]) | |
if current_pos < copies: | |
current_pos += 1 | |
else: | |
current_pos = 1 | |
number += 1 | |
page += 1 | |
scribus.setRedraw(True) | |
scribus.redrawAll() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment