[softwarelist] Re: Script for numbering

  • From: Pete Bready <pbready@xxxxxxxxxxxx>
  • To: davidpilling@xxxxxxxxxxxxx
  • Date: Thu, 4 May 2006 19:47:36 +0100

David Pilling <flist@xxxxxxxxxxxxxxxxxxx> wrote:

> > I need to number pages (which I CAN do via Insert...) but I only need to
> > number every other page, starting from page 3. So, to clarify, page 3
> > needs to be numbered 1, page 5 numbered 2, page 7 numbered 3 etc. I
> > guess, something along the lines of "Insert page number minus 3" would
> > suffice. But I'm clueless, can anyone help?
> 
> It depends what you want. In the sense you could type in the page numbers
> by hand, but that would probably be irritating if the pages changed. So
> presumably you want some sort of automatic page numbering.
> 
> I'm aware that someone has done a mail merge macro that allows things like
> 
> page X of N
> 
> to be printed, so extending that maybe one solution. Alas I can't bring to
> mind the exact location of that script?
> 
> There might be tricks to fit your exact situation, for example construct a
> document with left and right hand pages, have an auto link frame on the
> left hand page only, and then at the end of the day print left hand pages
> only.
> 
> 
> 
Hi

I think I was responsible for this years ago, although it has been a long
time since I've had to use OvnPro, but still dip in and out of here from
time to time. You'll find it at
http://www.bulldog.u-net.com/ovationpro/hints.html#pagexofy where it states:

----
Is there any way to get Ovation Pro to put "page x of y" automatically on
each page (i.e., page 1 of 4 on the first page, 2 of 4 on the second, etc)? 
Can I insert the document filename into the document automatically? 
Can I insert the current time into a document? 
Put the MERGE commands shown below into a file, set its type to OVPDDL, open
a blank Ovation Pro document and drag the OVPDDL file to it. Then use
Misc/Insert/merge tag to insert the necessary merge fields. You can then
preview the document using File/Mail Merge, clicking on the 'First' button
to see the results. The merge commands given allow you to also insert a
filename, and a current time. 

MERGE_02={merge 901 "time" "{gettimestring(\"%24:%MI:%SE\", macv)}"} 
MERGE_03={merge 902 "filename" "{fileinfo(currentfile(), macv)}"} 
MERGE_04={merge 903 "numpages" "{int i,n,f,c; f=currentfile();
c=documentchapters(f); for(i=0; i<c; i++)n+=chapterpages(i,f);
macv=itos(n)}"} 

Note: Merge requires that the CSV field has a valid entry. The First button
works OK, but when you try to print without a CSV entry it produces an error


Filing system ADFS: must be given a file name 

Any CSV file will do because the merge does not actually read any data from
there.
----

Although the above doesn't do what you want (!), you should be able to use
the same method to get the current page number and subtract 3 from it.
Unfortunately I haven't used OvnPro or my RiscPC for a long time so don't
have easy access to the documentation to find out what function to call.
However, for arguments sake, let's call it pagenum() so something like the
following should/might work:

MERGE_05={merge 904 "page-3" "{macv=pagenum() - 3}"}

Apologies if this is entirely off the mark!

Cheers


-- 
Pete Bready

Other related posts: