Ok, I see what is going on. Essentially, the first time the script modules are loaded the functions a() and b() get called. After that you just call the app.Print_Report.printReport() function. You need to put the function call to a and b inside of the printReport function so it gets called every time.[code]def printReport():
import system, app
print “Report print called”
app.Print_Report.a()
app.Print_Report.b()
def a():
import system
print “report Open called”
system.nav.openWindow(“Report PDF”)
print “report Opened”
def b():
import system
print “Report Printing”
win = system.gui.getWindow(“Report PDF”)
win.getRootContainer().getComponent(“Report Viewer”).print(None, 0)
print “Report should have printed”
system.tag.writeToTag(“Versa_Mill/Report_Ready_Flag”, 0)
system.nav.closeWindow(“Report PDF”)[/code]