[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. FM version FMcalc Date Installation file(s) Latest changes
    10 and later 1.0 2017-03-21 Inst-FMcalc.zip
    • First issue of FMcalc
    1.1 2017-11-03
    • Corrections: documentation; handling of non-numeric input from file; handling of boolean document settings.
    1.2 2017-12-30
    • Additional function Arc (deg, min, sec).
    • FMcalc_OpenPdf.exe renamed to FMxxx_OpenPdf.exe
    1.3 2018-03-09
    • Installation routine, name change for ZIP to Inst-FMcalc.zip
    • Changed project structure.
    • Bug hindering use of source files corrected.
    • Keyboard short cut for documentation changed to ESC q m d
  4. UnZip the file to the desktop (you get a file and a directory).
  5. Execute the file PrepareInstallation.exe.
    The language of the installation dialogues adapts to the UI language of your current FM installation (de, en, fr).
    This program modifies some values in the file InstallThis\config.ini.
  6. Use Continue Installation. This opens the installation program:
  7. Select the appropriate option(s):
  8. With Install the script and associated files will be transferred into the relevant locations.
  9. A message indicates the end of the installation. The desktop icons will be removed.

Uninstall the script

To uninstall the script, start the installation program from the short cut in the Start-menu > D+DD. Then use the Un-Install button.

This removes the script only from the locations defined in the options. You can later use the installation program again.

To get completely rid of the script you need to remove the following in addition to the un-installation:


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