Printing selected pages

Chipp Walters chipp at chipp.com
Sun Dec 18 21:01:37 EST 2005


Hi Sarah,

Sarah Reichelt wrote:
> Hi All,
> 
> I have a printing query today - Chipp, is that printing script
> conference stack ever going to appear?

Sorry, it's not going to get done. Jacque mentioned she expected it to 
be created at a 'beginner' level, and Dan already has a print e-book 
which covers just about all the basics. Since I helped him a bit during 
the writing, I'm not to keen to publish a stack going over the basics 
which competes against his.

Besides, I'm praying/hoping all the print routines will get a close look 
from RR in the future as I think we all believe they could use some work.

But to answer your question, the only way I know how to do this is to 
create your own print manager. AFAIK, the bug you describe is just that. 
I don't know of a workaround other than to build your own previewer and 
let your users select the pages they want to print (it does work 
correctly on the PC).

FYI, Here's how I do it on the Mac (OSX Tiger).

answer printer

it will give you a standard PageSetup dialog.

You can use that to figure out how to layout your printing on an 
offscreen stack. After finished creating the cards to print you can then 
preview them and choose which ones to let your user print. Delete the 
cards you don't want printed then:

put item 1 of printPaperSize into tW
put item 2 of printPaperSize into tH

open printing with dialog
set the defaultStack to "tempPrint"

repeat with x = 1 to the number of cards in stack "tempPrint"
    go cd x
    print card into 0,0,tW,tH
    print break
end repeat

close printing

(This also ends up printing a last blank page, but you can figure out 
how to fix that! OTCO)

This will give you a print dialog box where you can set the page range 
of the resulting repeat loop.

It's confusing as you would think you would see the dialog box *before* 
the repeat loop, but you see it after.

HTH


-Chipp


> 
> I have a routine to print a number of cards, but if the user selects a
> page range in the print dialog, how to I detect this and allow for it.
> 
> Here is a test script I have been using:
> 
> on mouseUp
>     open printing with dialog
>     put the result into tRes
>     if tRes = "Cancel" then exit to top
> 
>     print card 1
>     print card 7
>     print card 10
>     close printing
> 
>     answer tRes  -- for debugging purposes
> end mouseUp
> 
> Clicking "Cancel" in the print dialog works as expected, but if I
> choose to print page 1 only, I still get all 3 cards and "the result"
> is empty. It looks like "open printing with dailog" doesn't give me
> the info I need, so does anyone know of a workaround for this? I only
> need it for Mac OS X if that makes any difference.
> 
> I searched the archives and found a few references to this from
> several years ago, but no solution and nothing recent, so here's
> hoping there is an answer now.
> 
> TIA,
> Sarah




More information about the use-livecode mailing list