[Main topics] [Navigation]

FMcalc – Calculations in FrameMaker

FMcalc is an ExtendScript package which provides functions for calculations in FrameMaker:

Appreciation: This script would not have been possible without the generous help form the FrameMaker ExtendScript community. In particular I want to thank Klaus Göbel, Jang F.M. Graat, Jongware, Rick Quatro, Russ Ward and Markus Wiedemaier.

Note: This page does not describe all features of FMcalc. See the full documentation (pdf).

Marker types
Functions of the script
Example outputs
Document settings
Downloading and installing FMcalc

[To top/bottom of page] Marker types

#calc markers define formulas and how the results is stored and formatted

#xpos = #length * Cos(#alpha * @PI) There are a large number of functions (Cos) and constants (@PI) avialable via building blocks (to avoid typos).
#something = Sin(Sqrt(@PI/3)) {E5} Optional formatting information is in {}. I (integer), Jn (Integer with leading zeroes), Fn (decimal), En (scientific)
{E5} will create something like -1.23456×10-5 (5 decimal figures).
= #VAT * Prod(Left) "xmpl 02"; Valid only in table cell (referring to all cells to the left of the current).
No resulting variable is defined: output is directly after the marker.
Comments can be anywhere and are enclosed in straight quotes.
#total = Sum (Above) * (1 + #VAT) Valid only in a table cell. It refers to all cells above the current cell.
Result is stored in FM variable #total.

#series markers are an "extension to automatic numbering"

The idea for series came from the demand of 'decrementing counters', which is not possible with auto-number in paragraphs.. The result of series markers is always inserted in the document.

Marker contents Generated series in text with appropriate character format
Series= reverse_1; Scheme= Numeric; Start= 18.5; Incr= -4.1; Decimals= 2; 18.50, 14.40, 10.30, 6.20, 2.10, -2.00, -6.10, -10.20, …
Series = series_2; Scheme = ROMAN; Start = 5; Incr = -1; V, IV, III, II, I, NaN, NaN
(NaN stands for Not a Number: negative values are not defined for roman numerals).
Series= LeadingZeros; Scheme= Num000; Start= 15; Incr= -6; 0015, 0009, 0003, NaN
(NaN stands for Not a Number: negative values are not defined).
Series = zeiten; Scheme = OldTimesDE; Start = 1; Incr = 1 in alten zeiten This starts the textual numbering.
füher And here it is continued.
vor kurzem Shortly ago.
heute Today.
Series = hebrew_rainbow; Scheme = קשת; אדום Hebrew rainbow, 1st item (red)
כתום Hebrew rainbow, 2nd item (orange)
צהוב Hebrew rainbow, 3rd item (yellow)

[To top/bottom of page] Functions of the script

[To top/bottom of page] Document settings

This dialogue has tabs to set the various options for a document. These are stored on the reference page FMcalc.

Document settings: User variables Hancle document settings

[To top/bottom of page] Example outputs

Series = series_2; Scheme = ROMAN; Start = 6; Incr = -1;

The small mark in front of the VI is the indicator for series start (the functional character "optional hyphen".

Output from series one
Series = hebrew_rainbow; Scheme = קשת; Series with Hebrew text

[To top/bottom of page] Downloading and installing FMcalc

Note: All software from D+DD is Donationware - if you find it helpful for your work, think about supporting also my work.

  1. Close FrameMaker if necessary.
  2. Download the script file
  3. Date FM version FMcalc Installation file(s) Latest changes
    2017-03-21 10 and later 1.0 FMcalc.zip First issue of FMcalc
  4. UnZip the file to the desk top.
  5. Move the folder FMcalc to a location of your liking.
  6. Start FameMaker.
  7. Start the script (FMcalc.jsxbin) from the folder where You placed it. You will see a new menu item at the bottom of the Format menu.
  8. If you want the script to automatically start, copy the the following items of folder FMcalc to %appdata%\Adobe\FrameMaker\vv\Startup\ (vv being 10 …): FMcalc.jsxbin, FMcalc.pdf, FMcalc_OpenPdf.exe and FMcalc_tpl_xx.fm (where xx is the UI language code of your FM installation: de, en, fr).

Note: FMcalc.jsxbin is just the binary version of FMcalc.jsx including all sub-modules. Thus you have less files in the Startup folder.


Any software from D+DD is provided by the author and contributor "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed.

[Main topics] [Navigation]
 URL:  Created: 2016-05-20  Updated:
© Docu+Design Daube, Zürich    
  Business of Docu + Design Daube Documentation issues Sharing information Klaus Daube's personal opinions Guests on this site Home of Docu + Design Daube To main page in this category To first page in series To previous page in series To next page in series To bottom of page To top of page Search this site Site map Mail to webmaster To bottom of page To top of page