FMgraph – Graphics and diagrams in FrameMaker
FMgraph is an ExtendScript package which provides functions for creating graphics and diagrams in FrameMaker.
This library was designed to bypass the dysfunction of the ES functions as well as most implementation flaws (Only the most severe were corrected in FM 15.0.3.):
- There is no function - also not in the UI - to set or inspect a User String - which is used to identify graphic objects.
- Vertical or horizontal lines are not possible at all. The minimum width (or hight) working correctly is 1/8 pt (8192 units = 0.044mm) – bug FRMAKER-5819
- Polyline does not work at all. It creates an L-shaped line at the left and lower edges of the bounding box of the vertices – bug FRMAKER-5569
- There is no provision to use the pre-sets for line width (given in maker.ini), dash patterns (also in maker.ini) or arrow styles (defined in the UI) – bug FRMAKER-5568
- There is still a great problem with grouping vertical lines: if the last item in the group is a vertical line, then the origin (top left) is included in the group – bug FRMAKER-2029
- The installation and the script adapts its UI language to the FM-UI-language (de, en, fr).
L'interface utilisateur française a été créée avec le service web DeepL (https://www.deepl.com/translator). - Tested with FM-12 to FM-15 (2019). Due to lack of object property
app.UserSettingsDir
it can not run in FM-10 and FM-11.
Note: This page does not describe all features of FMgraph. See the full documentation (pdf).
Use cases of FMgraph
Functions of FMgraph
Downloading and installing FMgraph
Use cases of FMgraph
- Create diagram from data: The following demonstrates the presentation of data from a file with calendar axis and linear axis:
- Set or find User Strings: FMgraph can read data from an identified table. To identify tables (and anchored frames) FMgraph provides a special dialogue.
Functions of FMgraph
You may wish to read the full documentation.
- Bypass the faults of the ES functions as well as most implementation flaws.
- Reference point and rotation centre are identical for geometric objects (exception is Arc).
- Allow both the mathematical coordinate system (origin bottom left of the frame) and FM-coordinate system (origin top left in frame). This implies a different interpretation of rotation angles also.
- Allow usage of predefined properties (pen, line type, arrow style) to ease standardised drawings.
- Add functions for diagramming:
- Set up the anchored frame holding the diagram with background colour, grid, label and coordinate system indication
- Get data from files or tables.
- Scale values for proper diagramming.
- Draw linear, logarithmic and calendaric axes. The language for month names in the calendaric axes can be set or is taken from the anchoring paragraph or FM-UI.
- Draw linear and arbitrary (e.g. logarithmic) grids.
- Created objects are checked whether they are (partially) outside the anchored frame.
- The script adapts its UI language to the FM-UI-language (de, en, fr).
The script installs a menu item: Graphics > Graphic Library with the sub-menu:
- Documentation [ESC q g d]
- Search/name object [ESC q g t]
User scripts are set up in ESTK. They act on the open document at the current cursor location:
The dialogue to identify or find a table or an anchored frame is a palette which stays open while you manipulate the document:
The dialogue to inspect an object or anchored frame is a palette which stays open while you manipulate the document:
Downloading and installing FMgraph
Attention: Windows Defender may react to this installation with a virus warning. This is a false positive. You may check this with an upload to Virustotal
Please consult the complete documentation for instructions how to avoid intervention by Windows Defender. This most useful feature has the quirk to quarantine most compiled AHK scripts.
Note: All software from D+DD is Donationware - if you find it helpful for your work, think about supporting also my work.
- Download the installation file
- First issue of FMgraph
- Code comments, colour names de/fr, handling of penSize 0
- Test scripts amended
- Documentation revised
- Palette "Inspect/assign properties" added
- Order of objects when traversing document is now in apparent order
- Default background colour defined internally, minor bug fixes.
- Bypass for error FRMAKER-6610 (grouping purely vertical lines includes the container-origin) implemented for FM < 15.0.5
- Bypass for error FRMAKER-2406 (Distributing purely vertical lines enlarges the object area) implemented for FM < 15.0.6
- Correcting an error in DrawPolygon; Warning concerning FRMAKER-9134 (FM-16 does not show correct object properties for polygons).
- Some corrections in sample scripts and documentation.
- Installation: allow to define FM-version for which to install.
- Correcting an error in DrawPolarLine; It didn't do anything due to wrong check for initialisation.
- Correcting wrong OR statements which caused tilt of FM after successful executing scripts.
- Localisation now uses XML files
- Correction: errors in colour handling in non-en FM
- Correction: Assign properties for TextLine did not work as intended. only character format can be applied → to be done with standard methods by user.
- Find/identify objects: first object was not identified on refresh
- Correction: error in CollectFramesInBody suppressed the panel Identify Object to appear.
- Correction concerning Help file
- Change of message handling
- Correction: error in function ReadDataFromFile
- Documentation updated concerning installation and panel Find/(re-)name Document Objects.
- Handling of user string refined to coexist with other settings.
- Allow named search with regular expressions
- Corrections: some globals wrongly named; Navigation with named search etc.
- Correct grid size in landscape pages
- Allow for "marks only - no line" in DrawLineScaled
- Panel "Assign properties" does not show → Correct typo in FMgraph_PanlP.jsx
- Grid for landscape sized diagrams was to narrow (H/W interchanged).
- New function DrawSpikesScaled
- Before installing a new (updated) version, uninstall the current version: start the installation program from the short cut in the Start-menu > D+DD. Then use the Un-Install button.
- UnZip the file to the desktop (you get a file and a directory).
- Execute the file
PrepareInstallation.exe
(run as Administrator)
The language of the installation dialogues adapts to the UI language of your current FM installation (de, en, fr). - The last six FM-versions present in your
%appdata%/Adobe/FrameMaker/
are listed in the dialogue (on your system there may be only one).
- Select the FM-version for which you want to install FMgraph.
- Use Continue. This opens the installation program:
- Select the appropriate option(s):
- Use the first option to start the script automatically at FM-start.
- Use the second option if you wish to start the script on demand from a trusted source. You can define the script in File > Scripts … > Catalog (Script Library) as Favourite: use the Add button and navigate to
My Documents\Adobe Scripts\FMgraph\FMgraph.jsx
. -
With Install the script and associated files will be transferred into the relevant locations.
Inmaker.ini
a sectionD+DD
is established - A message indicates the end of the installation. The desktop icons will be removed.
FM version | Date | Version | Installation file(s) | Latest changes |
---|---|---|---|---|
12 and later (older versions miss object property |
2019-05-16 | 1.0 | Inst-FMgraph.zip FMgraph-examples.zip |
|
2019-05-22 | 1.01 | |||
2019-06-19 | 1.10 | |||
2019-09-11 | 1.20 | |||
2019-12-13 | 1.30 | |||
2020-03-07 | 1.40 | |||
2020-08-14 | 1.50 | |||
2021-01-14 | 1.60 | |||
2021-04-30 | 2.0 | |||
2021-05-06 | 2.1 | |||
2021-10-29 | 2.2 | |||
2022-02-01 | 2.3 | |||
2022-10-12 | 2.4 | |||
2022-12-16 | 2.4.1 | |||
2023-01-10 | 2.4.2 | |||
2023-03-10 | 2.5 |
Example files
You may download FMgraph-examples.zip with the test scripts. They were used for the documentation. Document _FMGraph-tpl.mif
therein provides the character formats and background colour defined in the global variables. See Installation and usage of FMgraph > Adaptation of global
variables
Un-install the script
To uninstall the script, start the installation program from the short cut in the Start-menu > D+DD; set the option(s) to define what to uninstall; then use the Un-Install button.
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:
- The short cut in the start menu
- Directory
%appdata%\D+DD\FMgraph
Caveat
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.