Author Topic: Search Scripts for Scale 100 Textframes + set new Font Size  (Read 118 times)

martinjenniges

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
  • Scribus User
Search Scripts for Scale 100 Textframes + set new Font Size
« on: August 05, 2018, 09:55:49 am »
Hello,

I am new in Scribus.
My first Project was an book with Soldiersletters from the Napoleons-War-Time from a old Book in Din-A5; 148 mm x 210 mm.

After finished this Project, I wouldt creat a new book with the same Text an Images for People, who need a greater Font Size. This new Book is in Din-A4; 210 mm x 297 mm.

Ergo, I need :

1. to change the Text Frames Size in 100 pages from 118 mm x 165 mm to 180 mm x 252 mm
2. change the Text Font Sizes from

Letter Titles 14 pt to 16 pt
Letter Text 10 pt to 14 pt
Image Sub-Title Text 9 pt to 12 pt

 My Question: Gives it Scripts which can makes this Changes ? Or is there in Scribus an easies way ?

Thanks for your answers!

See regard
Martin


a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1492
  • Karma: 20
    • the graphics lab
Re: Search Scripts for Scale 100 Textframes + set new Font Size
« Reply #1 on: August 05, 2018, 11:35:51 am »
hi martin

yes, it's manageable

you can first read

https://wiki.scribus.net/canvas/Category:Scripts

and then go through

https://wiki.scribus.net/canvas/Enlarge2Page

if you have further questions, just ask!

ciao
a.l.e

dragonfly

  • Jr. Member
  • **
  • Posts: 59
  • Karma: 0
  • Scribus User
Re: Search Scripts for Scale 100 Textframes + set new Font Size
« Reply #2 on: August 05, 2018, 05:31:17 pm »
In a similar experimental exercise I first copied the original *.sla file
then changed *.sla extension to *.xml
and opened file as XML in XMLCopyEditor ..

http://xml-copy-editor.sourceforge.net/

Try searching for patterns to make global changes.

[added note]
Actually, looking at my XMLCopyEditor, you can just open *.sla files without changing extension to *.xml.  Look at <PAGE and <STYLE elements.
« Last Edit: August 05, 2018, 05:43:21 pm by dragonfly »

martinjenniges

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
  • Scribus User
Re: Search Scripts for Scale 100 Textframes + set new Font Size
« Reply #3 on: August 19, 2018, 01:52:34 pm »
Hello,
I have me write a script, but Ireceive the following error

Traceback (most recent call last):
  File "<string>", line 10, in <module>
  File "C:\Program Files\Scribus 1.5.4\share\scripts\VergroesserungTextrahmen.py", line 35, in <module>
    meineRahmenBreite, meineRahmenHoehe = scribus.getSize(meinRahmen)
TypeError: coercing to Unicode: need string or buffer, tuple found

Here my script:
#!/usr/bin/env python
# -*- coding: utf-8  -*-

# VergroesserungTextrahemn.py
# this version 2018.08.06
#

import scribus

if scribus.haveDoc():
   if scribus.selectionCount() == 0:
      scribus.messageBox('Scribus - Script Error',
         "Es ist kein Textrahmen ausgewählt.\nBitte Textrahmen auswählen und starten Sie das Script neu.",
         scribus.ICON_WARNING, scribus.BUTTON_OK)
      sys.exit(2)
   if scribus.selectionCount() > 1:
      scribus.messageBox('Scribus - Script Error',
         "Sie haben mehr als einen Rahmen ausgewählt.\nBitte Textrahmen auswählen und starten Sie das Script neu.",
         scribus.ICON_WARNING, scribus.BUTTON_OK)
      sys.exit(2)

meineSeite = 1
meineSeitenAnzahl = scribus.pageCount()
meineSeiteBreite, meineSeiteHoehe = scribus.getPageSize()
meinOben,meinLinks,meinRechts,meinUnten = scribus.getPageMargins()
meinAusgewaehlterRahmen = scribus.getSelectedObject()
meineAlteRahmenBreite, meineAlteRahmenHoehe = scribus.getSize(meinAusgewaehlterRahmen)

while (meineSeite <= meineSeitenAnzahl):
   scribus.gotoPage(meineSeite)
   meineSeitenObjekteAnzahl = scribus.getPageItems()
   meinRahmen = 1
   for meinRahmen in meineSeitenObjekteAnzahl:
      if (meinRahmen[1] == 4):
         meineRahmenBreite, meineRahmenHoehe = scribus.getSize(meinRahmen)
         if (meinAlterRahmenBreite == meineRahmenBreite) and (meinAlterRahmenHoehe == meineRahmenHoehe) :
            scribus.sizeObject((meineSeiteBreite - meinLinks - meinRechts), (meineSeiteHoehe - meinOben - meinUnten), meinRahmen)
   meineSeite = meineSeite + 1
scribus.redrawAll()

What is the wrong code ?

Thank you for help

Martin

 

palmate