Category : DeskTop Publishing in the 1990's
Archive   : AMIBKLT.ZIP
Filename : BOOKLET.SMM

 
Output of file : BOOKLET.SMM contained in archive : AMIBKLT.ZIP

[ver]
4
[sty]
~macro.sty
[files]
[charset]
82
ANSI (Windows, IBM CP 1252)
[revisions]
0
[prn]
Panasonic KX-P1124
[lang]
1
[desc]





710030872
78
708726624
1737
5
0
0
0
0






0
[fopts]
0
1
0
0
[lnopts]
2
Body Text
1
[docopts]
5
2
[tag]
Body Text
2
[fnt]
Courier
240
0
32768
[algn]
1
1
0
0
0
[spc]
33
273
1
0
0
1
100
[brk]
36
[line]
8
0
1
0
1
1
1
10
10
1
[spec]
0
0

0
1
1
0
0
0
0
[nfmt]
280
1
2
.
,
$
Body Text
6
1
180
1
360
1
540
1
720
1
900
1
1080
0
[lay]
Standard
513
[rght]
15840
12240
1
720
720
1
900
720
2
1
0
1
1
2
1
720
11520
14
1
720
1
1440
1
2160
1
2880
1
3600
1
4320
1
5040
1
5760
1
6480
1
7200
1
7920
1
8640
1
9360
1
10080
[hrght]
[lyfrm]
1
11200
0
0
12240
900
0
1
3
1 0 0 0 0 0 0
0
0
1
[frmlay]
900
12240
1
720
0
1
360
720
0
1
0
1
1
0
1
720
11520
0
[txt]
<+B>Dr. Frankenholly's Booklet Macro

<+B>1992 by William D. Holly

<+B>

>
[frght]
[lyfrm]
1
13248
0
15120
12240
15840
0
1
3
1 0 0 0 0 0 0
0
0
2
[frmlay]
15840
12240
1
1440
360
1
14940
1440
0
1
0
1
1
0
1
1440
10800
0
[txt]
>
[elay]
[l1]
0
[pg]
5
56 0 41 32 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0
113 0 13 0 0 1 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0
170 0 69 0 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0
229 0 23 0 0 1 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0
271 0 12 1025 0 0 0 65535 65535 Standard 65535 0 0 0 0 0 0 0 0 0 65535 0 0 65535 0 0 0 0
[edoc]
<:#240,10800>'This macro presupposes that everything on a page is in a frame. AmiPro

<:#240,10800>'macro language has no simple way of selecting text in one column without

<:#240,10800>'the user doing the selecting. It is much simpler for the macro to take

<:#240,10800>'care of everything, and to do this, everything must be in a frame. What

<:#240,10800>'follows is a macro that will create a new document that, when printed,

<:#240,10800>'will be in booklet order. I hope it works for you!

<:#240,10800>

<:#240,10800><:f,QCourier,>FUNCTION Booklet<:f><:f,QCourier,>()

<:#240,10800>ONERROR endit

<:#240,10800>ONCANCEL endit

<:#240,10800>

<:#240,10800>'Check for other open files and either close them or quit.

<:#240,10800>

<:#240,10800>FCount = GetOpenFileCount()

<:#240,10800>If FCount <;> 1

<:#480,10800> Decide = MultiDecide("More than one file is open. Choose ""OK"" to close all other files or ""Cancel"" to quit.", (1 + 16))

<:#240,10800> If Decide = 2

<:#240,10800> Message("Booklet process is terminating!")

<:#240,10800> Exit Function

<:#240,10800> Endif

<:#240,10800> BkFile = GetOpenFileName$()

<:#240,10800> For F = 1 to FCount

<:#240,10800> NextWindow

<:#240,10800> ChkFile = GetOpenFileName$()

<:#240,10800> If Chkfile != BkFile

Closed = FileClose()

If Closed != 1

Message("Booklet process is terminating!")

GoTo Endit

Endif

Endif

<:#240,10800> Next

<:#240,10800>Endif

<:#240,10800>

<:#240,10800>'Find out how many pages the document has.

<:#240,10800>

<:#240,10800>GotoCmd(3, 0, 0)

<:#240,10800>PageNo = GetPageNo()

<:#240,10800>

<:#240,10800>'Determine the number of booklet pages.

<:#240,10800>

<:#240,10800>pages = (PageNo * 2)

<:#240,10800>GotoCmd(1, 1, 0)

<:#240,10800><:f,QCourier,>

<:#240,10800><:f,QCourier,>'Determine if the number of booklet pages is<:f><:f,QCourier,>
<:f><:f,QCourier,>evenly divisible by 4<:f><:f,QCourier,>.

<:#240,10800><:f,QCourier,>

<:#240,10800><:f,QCourier,>bookchk = Mod(Pages, 4)<:f>

<:#240,10800><:f,QCourier,>if bookchk <;> 0

<:#720,10800><:f,QCourier,>Message("Booklet pages must be evenly divisible by 4. This document has {PageNo} physical pages which will produce {pages} booklet pages. Either increase or decrease the total number of physical pages by 1.")

<:#240,10800><:f,QCourier,>EXIT FUNCTION

<:#240,10800><:f,QCourier,>endif

<:#240,10800><:f,QCourier,>FullPageView()

<:#240,10800><:f,QCourier,>

<:#240,10800><:f,QCourier,>'Get all parameters of current document.<:f>

<:#240,10800><:f,QCourier,>

<:#240,10800><:f,QCourier,>DocStyle = GetDocInfo$(3)<:f>

<:#480,10800><:f,QCourier,>Defstr Length, Width, Units, Papertype, Fwidth, Fheight, Ftop, Fleft, LFM, TFM, RFM, BFM;

<:#240,10800><:f,QCourier,>GetLayoutPageSize(&Length, &Width, &Units, &Papertype)<:f>

<:#240,10800><:f,QCourier,>Cnt = GetLayoutParmCnt(ModLayoutRightPage)<:f>

<:#240,10800><:f,QCourier,>Hcnt = GetLayoutParmCnt(ModLayoutRightHeader)<:f>

<:#240,10800><:f,QCourier,>Fcnt = GetLayoutParmCnt(ModLayoutRightFooter)<:f>

<:#240,10800>DIM Parms(Cnt)

<:#240,10800>DIM HParms(Hcnt)

<:#240,10800>DIM FParms(Fcnt)

<:#240,10800>GetLayoutParameters(ModLayoutRightPage, &Parms)

<:#240,10800>GetLayoutParameters(ModLayoutRightHeader, &HParms)

<:#240,10800>GetLayoutParameters(ModLayoutRightFooter, &FParms)

<:#240,10800>

<:#240,10800>'The only parameter not obtained is the orientation of the original

<:#240,10800>'document. The user must supply this information.

<:#240,10800>

<:#240,10800>Lndscp = Decide("Is this document in Landscape Orientation?")

<:#240,10800>If Lndscp <;> 0

<:#240,10800> Papertype = (256 + {Papertype})

<:#240,10800>Endif

<:#240,10800>

<:#240,10800>

<:#240,10800>'DarkMode can be used so that the screen doesn't have to refresh all

<:#240,10800>'information.

<:#240,10800>

<:#480,10800>DM = Decide("Do you to turn Dark Mode on? Choosing ""Yes"" will enhance the speed. Choosing ""No"" allows you to see the macro work.")

<:#240,10800>If DM = 1

<:#240,10800> DarkMode(1)

<:#240,10800>Endif

<:#240,10800>

<:#240,10800>'Create a new document based on the original.

<:#240,10800>

<:#240,10800>New("{DocStyle}", 0, 0)

<:#240,10800>ModlayoutInit(512)

<:#240,10800>ModLayoutPageSize(Length, Width, Units, Papertype)

<:#240,10800>AmiProIndirect(ModLayoutRightPage, &Parms, Cnt)

<:#240,10800>AmiProIndirect(ModLayoutRightHeader, &HParms, Hcnt)

<:#240,10800>AmiProIndirect(ModLayoutRightFooter, &FParms, Fcnt)

<:#240,10800>ModLayoutFinish()

<:#240,10800>FullPageView()

<:#240,10800>NextWindow

<:#240,10800>

<:#240,10800>'Get the mid-point of the page.

<:#240,10800>

<:#240,10800>midpage = ({Width} / 2)

<:#240,10800>

<:#240,10800>'Begin to find and create all odd numbered pages for booklet. "Odd

<:#240,10800>'numbered" means that they exist on the left side of the page.


<:#240,10800>OddPage = 1

<:#240,10800>While OddPage <<= PageNo

<:#240,10800>

<:#240,10800>'Check to make certain that at least one frame exists on each physical page

<:#240,10800>'and if not, bail out!

<:#240,10800>

<:#240,10800> ChkFrame = GoToCmd(4, 0, 1)

<:#240,10800> If ChkFrame != 1

<:#240,10800> Message("No frame was found on this page. Terminating Macro!")

<:#240,10800> DarkMode(0)

<:#240,10800> Exit Function

<:#240,10800> Endif

<:#240,10800>

<:#240,10800>'Find and mark all frames.

<:#240,10800> DIM Fnames(1)

<:#240,10800> bkmk = ""

<:#240,10800>

<:#240,10800>'Sometimes AmiPro gives a frame a name that is based on the sequence in

<:#240,10800>'which it was created. That name will always be "Frame" and the sequence

<:#240,10800>'number, i.e. "Frame24" The macro must be able to control the marking of

<:#240,10800>'every frame on the page.

<:#240,10800>

<:#240,10800> While bkmk = "" or bkmk <;> "Frame"

<:#240,10800> bkmk = GetMarkText$()

<:#240,10800> If bkmk = "" or bkmk <;> "Frame"

<:#240,10800> bkmkpg = ({bkmkpg} + 1)

<:#240,10800> MarkBookMark({bkmkpg}, AddBookMark)

<:#240,10800> ArrayInsert(&Fnames, {bkmkpg}, {bkmkpg})

<:#240,10800> GoToAgain

<:#240,10800> bkmk = GetMarkText$()

<:#240,10800> Endif

<:#240,10800> wend

<:#240,10800> Size = ArraySize(&Fnames)

<:#240,10800> For I = 1 to Size

<:#240,10800> SelectFrameByName(I)

<:#480,10800> GetCurFrameBorders(&Fwidth, &Fheight, &Ftop, &Fleft, &LFM, &TFM, &RFM, &BFM, &Units)

<:#240,10800>

<:#240,10800>'Select only those frames on the left side of the page. Then copy them to

<:#240,10800>'the new document and move them over to the right side of the page.

<:#240,10800>

<:#240,10800> If Fleft << midpage

<:#240,10800> copy

<:#240,10800> NextWindow

<:#240,10800> paste

<:#240,10800> Fleft = ({Fleft} + {midpage})

<:#240,10800> FrameModInit()

<:#480,10800> FrameModBorders(Fwidth, Fheight, Ftop, Fleft, LFM, TFM, RFM, BFM, Units)

<:#240,10800> FrameModFinish()

<:#240,10800> NextWindow

<:#240,10800> Endif

<:#240,10800> Next

<:#240,10800> NextWindow

<:#240,10800> Count = GetBookMarkCount()

<:#240,10800>

<:#240,10800>'This procedure is used to restore the original precedence of each frame on

<:#240,10800>'a booklet page. It is essential if text wrapped around a graphic is to

<:#240,10800>'work!

<:#240,10800>

<:#240,10800> If Count <;> 1

<:#240,10800>

<:#240,10800>'If count is 1 or 0, the SendFrameToBack command would be grayed causing an

<:#240,10800>'error and halting the macro.

<:#240,10800>

<:#240,10800> SendFrameToBack()

<:#240,10800> Endif

<:#240,10800>

<:#240,10800>'Position new document to receive next odd page. This also serves to

<:#240,10800>'unselect the last frame. It must happen before next procedure.

<:#240,10800>

<:#240,10800> PageDown

<:#240,10800>

<:#240,10800>'If count is 0, the DIM call will cause a memory error.

<:#240,10800>

<:#240,10800> If Count <;> 1

<:#240,10800> DIM Names(Count)

<:#240,10800>

<:#240,10800>'Clear all bookmark names

<:#240,10800>

<:#240,10800> GetBookMarkNames(&Names)

<:#240,10800> For I = 1 to Count

<:#240,10800> ThisMark = Names(I)

<:#240,10800> MarkBookMark({ThisMark}, DeleteBookmark)

<:#240,10800> Next

<:#240,10800> Endif

<:#240,10800> NextWindow

<:#240,10800>

<:#240,10800>'Position original document for copying the next odd page and clear all

<:#240,10800>'bookmarks from the document.

<:#240,10800>

<:#240,10800> PageDown

<:#240,10800> For I = 1 to Size

<:#240,10800> ThisMark = Fnames(I)

<:#240,10800> MarkBookMark({ThisMark}, DeleteBookmark)

<:#240,10800> Next

<:#240,10800> OddPage = ({OddPage} + 1)

<:#240,10800> bkmkpg = 0

<:#240,10800>wend

<:#240,10800>NextWindow

<:#240,10800>

<:#240,10800>

<:#240,10800>'When all odd numbered "booklet" pages have been created, go back and do it

<:#240,10800>'all again with even pages. This time the Original document stays on the

<:#240,10800>'last page and moves up while the new document goes to the first page and

<:#240,10800>'moves down. Even pages move to the left side in the new document

<:#240,10800>

<:#240,10800>GoToCmd(1, 1, 0)

<:#240,10800>NextWindow

<:#240,10800>PageUp

<:#240,10800>EvenPage = 1

<:#240,10800>While EvenPage <<= PageNo

<:#240,10800> ChkFrame = GoToCmd(4, 0, 1)

<:#240,10800> DIM Fnames(1)

<:#240,10800> bkmk = ""

<:#240,10800> While bkmk = ""

<:#240,10800> bkmk = GetMarkText$()

<:#240,10800> If bkmk = "" or bkmk <;> "Frame"

<:#240,10800> bkmkpg = ({bkmkpg} + 1)

<:#240,10800> MarkBookMark({bkmkpg}, AddBookMark)

<:#240,10800> ArrayInsert(&Fnames, {bkmkpg}, {bkmkpg})

<:#240,10800> GoToAgain

<:#240,10800> bkmk = GetMarkText$()

<:#240,10800> endif

<:#240,10800> wend

<:#240,10800> Size = ArraySize(&Fnames)

<:#240,10800> For I = 1 to Size

<:#240,10800> SelectFrameByName(I)

<:#480,10800> GetCurFrameBorders(&Fwidth, &Fheight, &Ftop, &Fleft, &LFM, &TFM, &RFM, &BFM, &Units)

<:#240,10800> If Fleft <;> midpage

<:#240,10800> copy

<:#240,10800> NextWindow

<:#240,10800> paste

<:#240,10800> Fleft = ({Fleft} - {midpage})

<:#240,10800> FrameModInit()

<:#480,10800> FrameModBorders(Fwidth, Fheight, Ftop, Fleft, LFM, TFM, RFM, BFM, Units)

<:#240,10800> FrameModFinish()

<:#240,10800> NextWindow

<:#240,10800> Endif

<:#240,10800> Next

<:#240,10800> NextWindow

<:#240,10800> Count = GetBookMarkCount()

<:#240,10800> If Count <;> 1

<:#240,10800> SendFrameToBack()

<:#240,10800> Endif

<:#240,10800> PageDown

<:#240,10800> If Count <;> 1

<:#240,10800> DIM Names(Count)

<:#240,10800> GetBookMarkNames(&Names)

<:#240,10800> For I = 1 to Count

<:#240,10800> ThisMark = Names(I)

<:#240,10800> MarkBookMark({ThisMark}, DeleteBookmark)

<:#240,10800> Next

<:#240,10800> Endif

<:#240,10800> NextWindow

<:#240,10800> PageUp

<:#240,10800> For I = 1 to Size

<:#240,10800> ThisMark = Fnames(I)

<:#240,10800> MarkBookMark({ThisMark}, DeleteBookmark)

<:#240,10800> Next

<:#240,10800> EvenPage = ({EvenPage} + 1)

<:#240,10800> bkmkpg = 0;

<:#240,10800> wend

<:#240,10800>NextWindow

<:#240,10800>GotoCmd(1, 1, 0)

<:#240,10800>NextWindow

<:#240,10800>endit:

<:#240,10800>darkmode(0)

<:#240,10800>NextWindow

END FUNCTION

>

[Embedded]
00013837
>
[macsum] 1
Booklet 0 0 43 7
[macse]
14 Booklet
20 00004082
19 00004082
0 1050
13
8 1
6 1
5 1
18 3
11 00000557
5 1
5 16
3 0
0 21 "More than one file is open. Choose ""OK"" to close all other files or ""Cancel"" to quit." [X]
13
8 2
6 2
5 2
18 0
11 00000291
0 3 "Booklet process is terminating!"
6 0
15
9
0 267
13
8 3
5 1
8 4
6 1
6 4
18 2
12 00000392
10 00000557
5 1
6 4
3 0
8 4
10 00000317
24 727
0 267
13
8 5
6 5
6 3
18 1
11 00000544
2 147 1
13
8 6
6 6
5 1
18 1
11 00000544
0 3 "Booklet process is terminating!"
10 00004082
10 00000359
2 452 1 3 0 0
0 294
13
8 7
6 7
5 2
4 0
8 8
2 452 1 1 1 0
0 788 "{8}" 4
13
8 9
6 9
5 0
18 3
11 00000885
0 3 "Booklet pages must be evenly divisible by 4. This document has {7} physical pages which will produce {8} booklet pages. Either increase or decrease the total number of physical pages by 1."
6 0
15
9
2 201 1
0 279 3
13
8 10
0 1282 &11 &12 &13 &14
0 1285 363
13
8 23
0 1285 364
13
8 24
0 1285 365
13
8 25
6 23
21 26 [X]
6 24
21 27 [X]
6 25
21 28 [X]
0 1286 363 &26
0 1286 364 &27
0 1286 365 &28
0 2 "Is this document in Landscape Orientation?"
13
8 29
6 29
5 0
18 3
11 00001216
5 256
6 14
3 0
8 14
0 2 "Do you to turn Dark Mode on? Choosing ""Yes"" will enhance the speed. Choosing ""No"" allows you to see the macro work."
13
8 30
6 30
5 1
18 0
11 00001394
0 292 1
2 101 1 "{10}" 0 0
2 361 1 512
2 362 1 "{11}" "{12}" "{13}" "{14}"
0 1287 363 &26 "{23}"
0 1287 364 &27 "{24}"
0 1287 365 &28 "{25}"
2 376 1
2 201 1
24 727
6 12
5 2
4 1
8 31
5 1
8 32
6 32
6 7
18 4
11 00002866
2 452 1 4 0 1
13
8 33
6 33
5 1
18 1
11 00001758
0 3 "No frame was found on this page. Terminating Macro!"
0 292 0
6 0
15
9
5 1
21 34 [X]
7 ""
8 35
6 35
7 ""
18 0
6 35
7 "Frame"
18 3
1 2
11 00002028
0 261
13
8 35
6 35
7 ""
18 0
6 35
7 "Frame"
18 3
1 2
11 00002015
6 36
5 1
3 0
8 36
2 466 1 "{36}" 4003
0 1041 &34 "{36}" "{36}"
24 458
0 261
13
8 35
10 00001786
0 1046 &34
13
8 37
5 1
8 38
6 37
6 38
18 2
12 00002140
10 00002386
5 1
6 38
3 0
8 38
10 00002061
0 797 "{38}"
0 795 &15 &16 &17 &18 &19 &20 &21 &22 &13
6 18
6 31
18 5
11 00002373
24 154
24 727
24 155
6 18
6 31
3 0
8 18
2 421 1
2 418 1 "{15}" "{16}" "{17}" "{18}" "{19}" "{20}" "{21}" "{22}" "{13}"
2 420 1
24 727
10 00002105
24 727
0 1039
13
8 39
6 39
5 1
18 3
11 00002451
2 408 1
24 186
6 39
5 1
18 3
11 00002661
6 39
21 40 [X]
0 1040 &40
5 1
8 38
6 39
6 38
18 2
12 00002608
10 00002661
5 1
6 38
3 0
8 38
10 00002529
6 38
22 40
8 41
2 466 1 "{41}" 4004
10 00002573
24 727
24 186
5 1
8 38
6 37
6 38
18 2
12 00002767
10 00002820
5 1
6 38
3 0
8 38
10 00002688
6 38
22 34
8 41
2 466 1 "{41}" 4004
10 00002732
6 32
5 1
3 0
8 32
5 0
8 36
10 00001592
24 727
2 452 1 1 1 0
24 727
24 185
5 1
8 42
6 42
6 7
18 4
11 00004051
2 452 1 4 0 1
13
8 33
5 1
21 34 [X]
7 ""
8 35
6 35
7 ""
18 0
11 00003213
0 261
13
8 35
6 35
7 ""
18 0
6 35
7 "Frame"
18 3
1 2
11 00003200
6 36
5 1
3 0
8 36
2 466 1 "{36}" 4003
0 1041 &34 "{36}" "{36}"
24 458
0 261
13
8 35
10 00002999
0 1046 &34
13
8 37
5 1
8 38
6 37
6 38
18 2
12 00003325
10 00003571
5 1
6 38
3 0
8 38
10 00003246
0 797 "{38}"
0 795 &15 &16 &17 &18 &19 &20 &21 &22 &13
6 18
6 31
18 3
11 00003558
24 154
24 727
24 155
6 18
6 31
3 1
8 18
2 421 1
2 418 1 "{15}" "{16}" "{17}" "{18}" "{19}" "{20}" "{21}" "{22}" "{13}"
2 420 1
24 727
10 00003290
24 727
0 1039
13
8 39
6 39
5 1
18 3
11 00003636
2 408 1
24 186
6 39
5 1
18 3
11 00003846
6 39
21 40 [X]
0 1040 &40
5 1
8 38
6 39
6 38
18 2
12 00003793
10 00003846
5 1
6 38
3 0
8 38
10 00003714
6 38
22 40
8 41
2 466 1 "{41}" 4004
10 00003758
24 727
24 185
5 1
8 38
6 37
6 38
18 2
12 00003952
10 00004005
5 1
6 38
3 0
8 38
10 00003873
6 38
22 34
8 41
2 466 1 "{41}" 4004
10 00003917
6 42
5 1
3 0
8 42
5 0
8 36
10 00002916
24 727
2 452 1 1 1 0
24 727
0 292 0
24 727
6 0
15
9
00013862