Automated Solutions for FrameMaker..

Archive for the ‘Extendscript’ Category

Extendscript solution to generate Paragraph, Character and Table Format Descriptives

Hello FrameMaker users and Friends,

Too much of travelling kept us busy last fortnight. Was taking a look on the Framers list and found an interesting problem to solve- Link.

This script pulls out information on Paragraph, Character & Table tags from the active document and displays it in a HTML report.

HTML Tag Descriptives Report

Tag Descriptives Report

The report has three sections:

  1. Paragraph Formats
  2. Character Formats
  3. Table Formats

Each listing down different tag definitions and some associated properties for each tag in the document.

You can modify the script to add fields that are important to be captured in the report.

Overall a nice report to keep track of all tags and the related info in one report. We found it very useful while designing templates for a project. Hopefully anyone using this script will derive some benefit using this report.

Download the extendscript here (Right click and Save as) and rename pdf to jsx- TagDescriptives.jsx

Feel free to share your thoughts on it.



Extendscript: Remove trailing spaces after variables in your document

Hello everyone:

I was going through a query on the Adobe FrameMaker user to user forums, found this interesting problem statement:

And I thought, why not try and solve this problem statement. Had fun solving it.
Sharing it for the benefit of the FrameMaker Extendscript community.
var doc = app.ActiveDoc
var variable = doc.FirstVarInDoc

var tr1 = variable.TextRange; //text range of the variable

	/*text range for next possible char*/
    var tl1 = new TextLoc(tr1.end.obj, tr1.end.offset + 1);	
    var tl2 = new TextLoc(tr1.end.obj, tr1.end.offset + 2);	
    var tr2  = new TextRange (tl1, tl2)

	var textitems = doc.GetTextForRange (tr2, Constants.FTI_String);

	if (textitems.length > 0)
		var str = textitems[0].sdata;
		if(str != " ") //if space then add text
			 doc.AddText (tr2.beg, " ");        
	variable = variable.NextVarInDoc;

Hope this solution nails the problem statement. It might also lead you to attack similar problems under different contexts.

Best Wishes:

Extendscript for FrameMaker

ExtendScript is an extended implementation of JavaScript that provides a scripting interface for FrameMaker and many other Adobe applications. For more information on ExtendScript, see JavaScript Tools Guide.

ExtendScript is easy to learn, especially if you are familiar with FDK or a scripting language like JavaScript.

Available Documentation:

Introduction to Scripting in FrameMaker