I have had a tinker and cannot get the button to disappear for when the printInvoiceis called,
Code: Select all
on printInvoice
set the visible of button "btnPrint" to "false"
put specialFolderPath("documents") & "/Invoice013.pdf" into tPDFPath
-- Handle the default text of the myCompany field
if the text of field "myCompany" is "Your company" then
set the visible of field "myCompany" to false
else
set the visible of field "myCompany" to true
end if
open printing to pdf tPDFPath
if the result is "Cancel" then
exit printInvoice
else
--print card "invoice" of this stack from 0,0 to 575,600 into 0,0,575,800
print card "invoice" of this stack into 0,0,575,800
end if
close printing
set the visible of button "btnPrint" to "true"
end printInvoice