Stefano,

Your logic is working, but you need to specify the scribus namespace when 
calling Scribus functions. Also,
I don't think you needed the various 'self' references.

Here's a working version of the script you posted:

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

import scribus

#-------------------------------------------------------------------
def isodd(n): return 1 == n % 2;
#-------------------------------------------------------------------

def appendPage(self) :
    scribus.messageBox("Debug","AppendingNewPage")
    scribus.newPage(-1)
    if not isodd(scribus.currentPage()):
        scribus.messageBox("Debug","IS Even!!!")
        pgTop,pgLeft,pgRight,pgBottom=scribus.getPageMargins()
        # Now swap left and right margins
        scribus.setMargins(pgRight,pgLeft, pgTop,pgBottom)
#-------------------------------------------------------------------
appendPage(scribus.currentPage)






Reply via email to