<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Thanks for that.<br><br>Must confess, will have to study your code for a while to figure out wots going on - close to the limit of my current understanding.<br><br>I did wonder though if maybe you could help once more.<br><br>I've been writing some scripts to manipulate objects, but they all rely on the default Basepoint position.<br><br>Do you know of a script function that will allow setting of the Basepoint?<br><br>(didn't notice it in the list when using dir() and F9 with Scripter console)<br><br>Regards<br><br><br>> From: joseantoniorocha@gmail.com<br>> Date: Sun, 12 Dec 2010 18:00:54 -0200<br>> To: scribus@lists.scribus.info<br>> Subject: Re: [scribus] scribus script to write current document name<br>> <br>> 2010/12/12 michael biggs <mjbiggs@hotmail.com><br>> <br>> ><br>> > Hello José<br>> ><br>> > that is an excellent solution - exactly what I was seeking.<br>> ><br>> > have tried it and it works.<br>> ><br>> > great to know about listing undocumented functions via Scripter Console<br>> > too.<br>> ><br>> > thanks very much<br>> ><br>> > Mike<br>> ><br>> <br>> You're welcome!<br>> <br>> I don't know this command too, until seek for via console dir().<br>> <br>> It makes possible get style settings directly from SLA file (there's no<br>> build-in command for that), using Python module *xml.parsers.expat*<br>> I need this to resize headline frames according headlines spaces above and<br>> below and linespaces :<br>> <br>> import xml.parsers.expat<br>> <br>> styles = {}<br>> charstyles = {}<br>> <br>> def start_element(name, attrs):<br>> #print 'Start element:', name, attrs<br>> if name == 'STYLE':<br>> styles[attrs[u'NAME']] = attrs<br>> if name == 'CHARSTYLE':<br>> charstyles[attrs[u'CNAME']] = attrs<br>> <br>> def getParagraphStyle(styleName):<br>> '''Return a dictionary with paragraph style parameters.'''<br>> try:<br>> res = styles[styleName]<br>> except:<br>> print styleName,'not in style sheet.'<br>> res = ''<br>> return res<br>> <br>> def getStyleLineSpacing(styleName):<br>> dic = getParagraphStyle(styleName)<br>> if (dic == {}):<br>> res = ''<br>> else:<br>> res = int(dic['LINESP'])<br>> return res<br>> <br>> def getStyleSpaceAbove(styleName):<br>> dic = getParagraphStyle(styleName)<br>> if dic == {}:<br>> res = ''<br>> else:<br>> res = int(dic['VOR'])<br>> return res<br>> <br>> def getStyleSpaceBelow(styleName):<br>> dic = getParagraphStyle(styleName)<br>> if dic == {}:<br>> res = ''<br>> else:<br>> res = int(dic['NACH'])<br>> return res<br>> <br>> def getStyleLineSpaceMode(styleName):<br>> '''0=fixed, 1=proportional'''<br>> dic = getParagraphStyle(styleName)<br>> if dic == {}:<br>> res = ''<br>> else:<br>> res = int(dic['LINESPMode'])<br>> return res<br>> <br>> p = xml.parsers.expat.ParserCreate('UTF-8')<br>> p.StartElementHandler = start_element<br>> *docName = scribus.getDocName()*<br>> file = open(docName,'r')<br>> p.ParseFile(file)<br>> file.close()<br>> <br>> # tests:<br>> print styles<br>> print charstyles<br>> print getStyleLineSpacing(u'Head 1')<br>> <br>> -- <br>> ------------------------------<br>> [image: Meira]nome: "José Antonio Meira da Rocha" tratamento: "Prof. MS."<br>> cargo: "Coordenador do Curso de Relações Públicas Multimídia"<br>> ies: "CESNORS/Universidade Federal de Santa Maria"<br>> googletalk: email: MSN: joseantoniorocha@gmail.com<br>> ICQ: 658222 Skype: "meiradarocha_jor"<br>> veículo: [ http://meiradarocha.jor.br ]<br>> fone: (55) 9651-0686<br>> ------------------------------<br>> -------------- next part --------------<br>> An HTML attachment was scrubbed...<br>> URL: <http://lists.scribus.info/pipermail/scribus/attachments/20101212/74caedc4/attachment.htm><br>> _______________________________________________<br>> scribus mailing list<br>> scribus@lists.scribus.info<br>> http://lists.scribus.info/mailman/listinfo/scribus<br>                                            </body>
</html>