Stephen,
Here's what I did by cannibalizing around. Excuse the commented out lines. Give it a try.
1. I made a stack called PdfMaker and put a field on it called PdfField on its card 1:
on mouseUp
global pdfname
put "Finished Document.pdf" into pdfname
open stack "MyPdfStack"
go cd 1 of stack "MyPdfStack"
close stack "MyPdfStack"
end mouseUp
2. I made a substack called "MyPdfStack" with the following stack script.
The stack has four cards with a field on each one called page1 (for the first card) and page2, page3, and page4 on the other three.
ON OPENSTACK
set the loc of this stack to the screenLoc
put cd fld "PdfField" of cd 1 of stack "PDFmaker" into cd fld "page1" of cd 1 of stack "MyPdfStack"
printcards
end OPENSTACK
ON OPENstack
set the loc of this stack to the screenLoc
put cd fld "PdfField" of cd 1 of stack "PDFmaker" into cd fld "page1" of cd 1 of stack "MyPdfStack"
printcards
end OPENstack
on printCards
## Path to the pdf file we want to create
put specialFolderPath("desktop") & "/Finished Document.pdf" into tPDFPath
open printing to pdf tPDFPath
if the result is "Cancel" then
## The user has cancelled printing
exit printCards
else
print card 1 of this stack into 0,0,575,800
--print bookmark "1 Introduction" with level 1 at 4,2
--print bookmark "1.1 Welcome" with level 2 at 4,96
if not (fld page2 of cd 2 is empty) then
print break
print card 2 of this stack into 0,0,575,800
print link to url "
http://lessons.runrev.com" with rect 408,34,518,52
end if
if not (fld page3 of cd 3 is empty) then
print break
print card 3 of this stack into 0,0,575,800
print link to url "
http://lessons.runrev.com" with rect 408,34,518,52
end if
if not (fld page4 of cd 4 is empty) then
print break
print card 4 of this stack into 0,0,575,800
print link to url "
http://lessons.runrev.com" with rect 408,34,518,52
end if
print break
## Print bookmarks
--print bookmark "1.2 Where to begin" with level 2 at 4,2
--print bookmark "1.3 System Requirements" with level 2 at 4,96
--print bookmark "1.3.1 All Operating Systems" with level 3 at 4,273
--print bookmark "1.3.2 Requirements for Windows System" with level 3 at 4,414
--print bookmark "1.3.3 Requirements for Linux Systems" with level 3 at 4,605
end if
Answer "Your PDF document is entitled 'Finished Document.pdf' and it will be saved on the desktop and launched."
--launch document specialFolderPath("desktop") & "/Finished Narrative.pdf"
launch document tPDFPath
close printing
end printCards