Why this problem
Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller
Why this problem
Using this script on a "Print" button causes the printing to hang, forcing a force quit of Revolution. There's an endless loop somewhere but I can't find it. Rev 2.8.1 on Mac OSX 10.4.10.
If I take out the 2nd line, "open printing with dialog", it works fine but goes straight to the last selected printer, removing the page setup and number of copies function of a normal printing dialog.
Any help appreciated.
on mouseUp
open printing with dialog
hide button "Print"
hide button "Next Screen"
hide button "Previous Screen"
hide button "Main Screen"
hide button "Ideas"
set the printScale to .6
print this card
show button "Print"
show button "Next Screen"
show button "Previous Screen"
show button "Main Screen"
show button "Ideas"
end mouseUp
If I take out the 2nd line, "open printing with dialog", it works fine but goes straight to the last selected printer, removing the page setup and number of copies function of a normal printing dialog.
Any help appreciated.
on mouseUp
open printing with dialog
hide button "Print"
hide button "Next Screen"
hide button "Previous Screen"
hide button "Main Screen"
hide button "Ideas"
set the printScale to .6
print this card
show button "Print"
show button "Next Screen"
show button "Previous Screen"
show button "Main Screen"
show button "Ideas"
end mouseUp
Hi dalkin~
Try changing the order of your "open print with dialog" call. Set up all the formatting or hiding of objects prior to calling any print routine that interacts with the print driver.
Try changing the order of your "open print with dialog" call. Set up all the formatting or hiding of objects prior to calling any print routine that interacts with the print driver.
Code: Select all
on mouseUp
hide button "Print"
hide button "Next Screen"
hide button "Previous Screen"
hide button "Main Screen"
hide button "Ideas"
set the printScale to .6
open printing with dialog
print this card
show button "Print"
show button "Next Screen"
show button "Previous Screen"
show button "Main Screen"
show button "Ideas"
end mouseUp
thanks Lynn, still no luck I'm afraid. Same hang. It looks like the problem is that the call to "open printing ...", prior to the appearance of "print this card", hasn't specified what is to be printed. I've purchased and downloaded the http://www.shafermediastore.com "Printing in Revolution to OSX" and I'll see if I can sort it. Thanks for your advice though.
Hmm ... this looks like a logic problem to me, not necessarily a bug but I think it's got 6 legs"
As before:
on mouseUp
hide button "Print"
hide button "Next Screen"
hide button "Previous Screen"
hide button "Main Screen"
hide button "Ideas"
set the printScale to .6
print this card
show button "Print"
show button "Next Screen"
show button "Previous Screen"
show button "Main Screen"
show button "Ideas"
end mouseUp
This works as expected and the card is printed to the last used printer. The "show" and "hide" are generic to the card and not of consequence (I would have thought) to the script or its function.
When I add the "open printing with dialog" command however, no matter where I place it in the script, it causes the script to hang. Logic would suggest that "open printing with dialog" is incompatible with "print this card". The "open printing with dialog" command, if it's placed before "print this card" hasn't told the system what to print, surely. If it's placed after "print this card", the print command has already been sent to the printer (without dialog) and the user can't set eg. the number of copies etc.
Result? Hang!
The booklet I downloaded says at one part: "On OSX, append the with dialog option to the open printing command (Note that you cannot use this option with the stand-alone print command". I've asked the author to clarify.
As before:
on mouseUp
hide button "Print"
hide button "Next Screen"
hide button "Previous Screen"
hide button "Main Screen"
hide button "Ideas"
set the printScale to .6
print this card
show button "Print"
show button "Next Screen"
show button "Previous Screen"
show button "Main Screen"
show button "Ideas"
end mouseUp
This works as expected and the card is printed to the last used printer. The "show" and "hide" are generic to the card and not of consequence (I would have thought) to the script or its function.
When I add the "open printing with dialog" command however, no matter where I place it in the script, it causes the script to hang. Logic would suggest that "open printing with dialog" is incompatible with "print this card". The "open printing with dialog" command, if it's placed before "print this card" hasn't told the system what to print, surely. If it's placed after "print this card", the print command has already been sent to the printer (without dialog) and the user can't set eg. the number of copies etc.
Result? Hang!
The booklet I downloaded says at one part: "On OSX, append the with dialog option to the open printing command (Note that you cannot use this option with the stand-alone print command". I've asked the author to clarify.
Hello,
To make the OS actually execute the print job and have Revolution continue with other duties, you need to close printing after opening it.
Best,
Mark
[/img]
To make the OS actually execute the print job and have Revolution continue with other duties, you need to close printing after opening it.
Code: Select all
on foo
open printing with dialog
-- print this print that
close printing
end foo
Mark
[/img]
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode