on printPDF
lock messages
-- etc
unlock messages
end printPDF
I'm not sure why printing doesn't print all pages. The best way for you to find out is to set a debugging checkpoint and trace each line. Or add a check for "the result" after the print command, there may be an error in it.
So after adding the dubugging point in the print loop and seeing nothing I thought I might run it in the IDE and see what happened.
When it gets to printing the card it errors out and says:
"card or stack must be open to print it"
So i added -- openStack "Printing" to the start of the handler but it shows the stack even with the lock screen set..
on printPDF
-- PDF Printing
put specialFolderPath("documents") & "/Inspection.pdf" into tFilePath
put ("Print" & return & "Print2" & return) into tCardsToPrint
lock screen
open stack "Printing"
open printing to pdf tFilePath
if the result is "Cancel" then exit printPDF
repeat with x = 1 to the number of lines of tCardsToPrint
print card (line x of tCardsToPrint) of stack "Printing" into 110,50,500,700
print break
end repeat
close printing
close stack "Printing"
wait 2 seconds
unlock screen
mergReader tFilePath
end printPDF
Thanks everyone for all their help!!!!