OS print dialog
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
OS print dialog
When using
answer printer
to call up a standard OS print dialog by clicking a button, is there something else I need to do to get the "cancel" button (in the OS dialog) to function if a user decides not to print? I may be misunderstanding the user guide when it talks about using
answer printer
instead of one of the custom print libraries. Everything works great and just as it supposed to with the exception of the "cancel" button — it prints instead, just like the "print" button. I have tried a few different approaches in the script for the button (like, if the result is "cancel" then cancel printing, etc.), but this didn't work.
By the way, I don't think the custom printing features will work in this particular situation. I am not printing cards, fields, or images. I am printing snapshots of groups contained on cards.
I am new to the printing features, since none of previous projects required printing, so I am sorry if this is a dumb question. I would really appreciate any tips to help me understand this particular issue.
Thanks,
Scott
answer printer
to call up a standard OS print dialog by clicking a button, is there something else I need to do to get the "cancel" button (in the OS dialog) to function if a user decides not to print? I may be misunderstanding the user guide when it talks about using
answer printer
instead of one of the custom print libraries. Everything works great and just as it supposed to with the exception of the "cancel" button — it prints instead, just like the "print" button. I have tried a few different approaches in the script for the button (like, if the result is "cancel" then cancel printing, etc.), but this didn't work.
By the way, I don't think the custom printing features will work in this particular situation. I am not printing cards, fields, or images. I am printing snapshots of groups contained on cards.
I am new to the printing features, since none of previous projects required printing, so I am sorry if this is a dumb question. I would really appreciate any tips to help me understand this particular issue.
Thanks,
Scott
Hi Scott
I might be able to shed a little light here:
If you use this code:THen you get the correct print dialog with a cancel button.
Obviously, the above prints a field; if you want to print a snapshot of a set of controls, I'm guessing you have to useI haven't tried this, and a more experienced Revver might correct me, and anyhow, this would only work if you know the name of the snapshot...
A snapshot is an image, surely? My little time dealing with snapshots is that there's no way of naming the snapshot (not that I could find) or even finding the name automatically given when the snapshot is made.
So there we are, a little light, and a bit of mud...

I might be able to shed a little light here:
If you use this code:
Code: Select all
"revShowPrintDialog false, true
revPrintField the name of field "FieldAll"
Obviously, the above prints a field; if you want to print a snapshot of a set of controls, I'm guessing you have to use
Code: Select all
revPrintField the name of image "your group image"
A snapshot is an image, surely? My little time dealing with snapshots is that there's no way of naming the snapshot (not that I could find) or even finding the name automatically given when the snapshot is made.
So there we are, a little light, and a bit of mud...


If you import a snapshot it is an image, and you address it as 'last image' right after you did the snapshot. SoMy little time dealing with snapshots is that there's no way of naming the snapshot (not that I could find) or even finding the name automatically given when the snapshot is made.
Code: Select all
set the name of last image to "myImage"
lets you import the snapshot invisiblylock screen
set the paintcompression to "PNG"
import snapshot from image "i1"
set the name of last image to "imageForPrint"
hide image "imageForPrint"
unlock screen
regards
Bernd
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
Thanks for the replies to my problem. The information is useful, but I am still stuck. None of the custom print libraries in Rev [revShow..., revPrint...] functions exactly the way I need it to. I can get those to work when I am printing a field or a card, etc., but when printing overlapping images (some visible and some invisible) as a group, it doesn't print as it should. It only prints part of the images of the group (usually the rearmost layer). Using
gets me the standard OS dialog where everything is functional [copies, collate, etc.] and it prints great. It is all fine except the "cancel" button. It looks functional and I can click it, but it acts the same as the "print" button in both Windows and Mac platforms — not canceling anything, but going on to process and print the image.
I have no problems printing the snapshots of the image groups, just no way to "not" print them if the user changes his mind.
The User Guide says:
Thanks again,
Scott
Code: Select all
answer printer
I have no problems printing the snapshots of the image groups, just no way to "not" print them if the user changes his mind.
The User Guide says:
What else am I missing?Use the answer printer command to display a standard printer dialog prior to printing. If the user cancels the dialog, "cancel" will be returned by the result function.
Thanks again,
Scott
" It is all fine except the "cancel" button. It looks functional and I can click it, but it acts the same as the "print" button in both Windows and Mac platforms — not canceling anything, but going on to process and print the image. "
I haven't been following this but - a while back I wrote a printing 'thang' for an app and recollect using: if it is "Cancel" then exit
I had to change that to "result" INSTEAD of "it" for the script to work, or so I recollect. The old brain cells might be deceiving me on this however
I haven't been following this but - a while back I wrote a printing 'thang' for an app and recollect using: if it is "Cancel" then exit
I had to change that to "result" INSTEAD of "it" for the script to work, or so I recollect. The old brain cells might be deceiving me on this however

Hi Scott,
maybe this little snippet will help:
Hope that helps.
Best
Klaus
maybe this little snippet will help:
Code: Select all
on mouseup
## Show page setup Dialog
answer page setup
if the result = "cancel" then
exit mouseup
end if
## Show printer dialog
answer printer
if the result = "cancel" then
exit mouseup
end if
## Finally do your printing...
end mouseup
Best
Klaus
-
- Posts: 34
- Joined: Mon May 08, 2006 7:02 pm
Thanks everyone. With all of the suggestions and help, I figured out what was wrong. I did have a word wrong in my "if ... then" section, but even fixing that didn't completely solve the problem. What did finally fix it was when I noticed that I had one line out of place. In moving things around in the script, I had left the line setting the print margins before my "if ... then" line. This is what threw everything off.
For future users just beginning to experiment with printing, be sure to keep all instructions to the printer after the "if ... then" for canceling.
Thanks again everyone,
Scott
For future users just beginning to experiment with printing, be sure to keep all instructions to the printer after the "if ... then" for canceling.
Thanks again everyone,
Scott