Re: [scribus] python script result

2021-04-21 Thread JLuc
Le 21/04/2021 à 15:22, Gregory Pittman a écrit : > When I run ExtractText.py with a messageBox() to show the file saved to it shows me './pagecount.txt' to perhaps you should add that ./ at the beginning... OK a rights access issue. I could fix it not with ./ but with the absolute path /DATA/

Re: [scribus] python script result

2021-04-21 Thread Gregory Pittman
On 4/21/21 9:13 AM, Gregory Pittman wrote: > On 4/21/21 3:56 AM, JLuc wrote: >> Le 21/04/2021 à 01:00, Gregory Pittman a écrit : >>> On 4/20/21 5:15 PM, JLuc wrote: >>> I would say just experiment. >>> If a Scribus script writes to a file, what does a shell script say when it >>> reads the file? >

Re: [scribus] python script result

2021-04-21 Thread Gregory Pittman
On 4/21/21 3:56 AM, JLuc wrote: > Le 21/04/2021 à 01:00, Gregory Pittman a écrit : >> On 4/20/21 5:15 PM, JLuc wrote: >> I would say just experiment. >> If a Scribus script writes to a file, what does a shell script say when it >> reads the file? >> You could write the python so that it saves str(

Re: [scribus] python script result

2021-04-21 Thread JLuc
Le 21/04/2021 à 01:00, Gregory Pittman a écrit : On 4/20/21 5:15 PM, JLuc wrote: I would say just experiment. If a Scribus script writes to a file, what does a shell script say when it reads the file? You could write the python so that it saves str(value), though when the shell script reads the

Re: [scribus] python script result

2021-04-21 Thread JLuc
Le 20/04/2021 à 23:52, Neil Foster a écrit : > You could use a basic python script to parse the XML of .sla file rather > than running a script from within Scribus. I'm glad i asked because i discovered that XML parsing and quering ability ... and because you pointed to that search. Now i can perf

Re: [scribus] python script result

2021-04-20 Thread Gregory Pittman
On 4/20/21 5:15 PM, JLuc wrote: > Hello, > > I'd like to use the page count of a document in a shell script (linux) > A python script can access that count with `scribus.pageCount()` > > How can scribus script can output this as a string, > so it's used in a shell script afterward ? > Hi JLuc,

Re: [scribus] python script result

2021-04-20 Thread Neil Foster
You could use a basic python script to parse the XML of .sla file rather than running a script from within Scribus. E.g. 'countpages.py': import xml.etree.ElementTree as ET import sys def main(args): filename = args[1] tree = ET.parse(filename) root = tree.getroot() pages = ro