Quantcast
Channel: Adobe Community : All Content - FrameMaker Scripting
Viewing all 888 articles
Browse latest View live

How do I change the table's first row to a Heading row if it contains pgfs with tblHead tags

$
0
0

So far, I have the following in a JavaScript:

 

if (tbl.FirstRowInTbl.FirstCellInRow.FirstPgf.PgfFmt.Name === "tblHead")

        {

            if (tbl.FirstRowInTbl.RowType === 1)

                //1 is Constants.FV_ROW_BODY

                tbl.FirstRowInTbl.RowType = 0;

                // 0 is Constants.FV_ROW_HEADING

            else

                continue;

         }

        else

            continue;

 

This does not work. I'm not comfortable with tbl.FirstRowInTbl.FirstCellInRow.FirstPgf.PgfFmt.Name.

It is clearly wrong. How would I indicate I want to determine the tag of the first paragraph in the first row?

 

Any help is very much appreciated!

 

Thanks,

Ruth


Scripting tips

$
0
0

Hi Scripters, I want to offer some advice to those seeking scripting help. First of all, this forum isn't too busy, but there are some extremely helpful people on here. If you follow this advice, it will make it easier for willing people to help you.

 

One of the most important things you can do when solving a scripting problem is to isolate the problem to the smallest possible unit. For example, if you are solving a problem with tables, don't post code that processes all of the tables in the document. Isolate the code so it just works on the selected table. Or, if you are trying to apply a condition format to paragraphs, don't post all of the code for processing all of the components in a book. Instead, isolate your code to work on a single, selected paragraph. When code is isolated to small units like this, it makes it easier to test and troubleshoot. And when it doesn't work, it makes it easier for other people to stage things on their computers so they can see what is wrong.

 

In general, this is the best way to develop scripting solutions anyway. When your individual "units" are tested and debugged, you can expand the code out to process an entire document or book. As an added benefit, your code becomes more modular and easier to reuse in other scripts. I will try to follow up with some specific code examples so you can see how it works. Please let me know if you have any questions or comments. -Rick Quatro

Screen locking stops production in Framemaker Framescript application

$
0
0

We have hundreds of XML files. Those files are handled by Framescripts in Framemaker to generate a Framemaker book with more than 1000 pages. As soon as the screen is locked by user or automatically Framescript stops immediately. Has anyone a solution? Any suggestions?

 

Windows 7, Framemaker 10.0.2.419, Framescript 5.2R1p251

Is there support for the GraphicsFmt object in FrameMaker 11 ExtendScript?

$
0
0

I was reading the FDK documentation for FrameMaker 11 and I see that support has been added for Object formats using FO_GraphicsFmt.

 

Is there support for the GraphicsFmt object in FrameMaker 11 ExtendScript?

 

If not, when will it be added?

 

Another question: Will the ExtendScript documentation ever be improved?

Access MySQL from ExtendScript

$
0
0

Did anyone use ExtendScript to connect to a MySQL database, for retrieving and storing data?

"Favourite" scripts disappear on restarting FrameMaker 11

$
0
0

Hi all,

 

I am using FrameMaker 11 on a Windows 7 laptop.

 

The script catalog is a very handy way to easily access common scripts. However, the "favourites" section does not retain newly added scripts once the program is restarted.

 

Here is my workflow:

Open FM, open script catalog, add multiple scripts to "favourites," run any script, close FM, reopen FM, none of the scripts remain

 

If I do not run any of the scripts, they remain there the next time I open FM. However, running any script will remove all of them from the favourites section.

I've noticed that the scripts do remain in File -> Script -> History.

 

Is there any way to avoid this? It is very inconvenient to manually add the scripts back into the favourites section every time.

 

Thanks,

Trevor

Calling one script from another

$
0
0

InDesign has a nice mechanism for calling one script from another, so code can be made modular. What about FrameMaker ExtendScript? What methods are people using to call one script from another? Thanks for any suggestions.

 

Rick Quatro

Command object Delete() and CommandNum property issues

$
0
0

Hi,

 

FM11. I can't seem to get the Delete() method to work on commands, nor can I retreive the proper CommandNum property. For example:

 

cmd = DefineCommand(1111, "TestScriptCommand", "TestScriptCommand", "^q");

alert(cmd.CommandNum);

 

...the message box displays some other number, like 48 or something. Then, cmd.Delete() seems to have to effect, because the command stays active and remains on any menus where I placed it.

 

the Command() callback works OK. It properly executes on 1111 for the command.


Double click event on a specific element in a FrameMaker document

$
0
0

Using the Notification/Notify (FA_Note_PostMouseCommand/FA_Note_PostMouseCommand), I can check where in the structure or which element was clicked and if a specific element was clicked, a dialog window opens to perform certain actions. But I would like to have that action occur only on a double click.

 

Any suggestions?

 

Thanks,

Trent Schwartz

Applying Conditional Text with SetProps()

$
0
0

Hi all,

 

I'm using FM 11 on Windows 7.

 

I'm having trouble deciphering the scripting guide (http://help.adobe.com/en_US/framemaker/scripting/framemaker_10_scripting.pdf) in relation to the SetProps() function. Specifically, I haven't been able to find a good description of the TypedVal properties (p. 400). Does anyone know of a document that describes these properties and how to use them?

 

My current task is to apply a conditional format to a row, but I would also like to apply a condfmt to an entire table. Here is my most recent (unsuccessful) attempt:

 

function setRowConditional(row, condFmt)
{    var props = row.GetProps();    var prop = new PropVal();    prop.propIdent.num = Constants.FP_InCond;    prop.propVal.ival = condFmt.id;    prop.propVal.obj = condFmt;    props.push(prop);    row.SetProps(props);
}

 

Thanks,

Trevor

Getting data from Excel

$
0
0

With FrameScript, I am able to use its EActiveXObject object to read and write to Excel spreadsheets. I need to read some data from Excel with ExtendScript. Has anyone figured out a way to do this with ExtendScript. My client wants to avoid intermediate formats like csv or xml, if possible. Any pointers and advice would be appreciated. Thanks. -Rick

Extract graphics in separated fm files

$
0
0

Hello,

 

Iam a beginnerinExtendScriptand I needto outsourcethegraphicsof mydocs. I wish tocreate a file .fmfor each graphfound in thedocto be able togenerate the imagesapartand not havetorebuildfor each change ofdoc.

 

I advanceslowlywith thedocsand examplesthatI foundbut Istill can notdo whatI want.

 

For now Iwanted to do thisas follows:

 

var doc = app.ActiveDoc;
if(doc.ObjectValid()) {       var inset = doc.FirstGraphicInDoc;       while(inset) {         // Create empty doc from a template         var newDoc = SimpleNewDoc(File($.fileName).parent.fsName+ "\\" + "DocGraphicTemplate", 0);            // Insert graphic in created doc.         // I still don't know how to do this...         newDoc.addGraphic(inset);            // Save doc with graphic in .fm file         newDoc.Save(docPath, newDoc, params);         // Replace graphic element in doc by the image generated from the newDoc .fm file         // I still don't know how to do this too         inset=inset.NextGraphicInDoc    }
} else {    alert("No active document could be found!");
}

 

Is thisthe right wayto do?If socan someonehelp me onthesticking points?

Set the output format images generated from graphic elements

$
0
0

Hello,

 

WhenI save as XML, mygraphicelements generate image files with several extensions .mif, .jpeg, .gifor others.

 

Is itpossible to forcean output format?

Add elements to doc

$
0
0

Hi,

 

I want to know if this is possible to manipulate fm objects to add existing elements (instanciated objects) to a document.

 

I saw multiple ways to create doc objects but I can't found any way to add it anything but text.

I saw in the api some functions to create new elements, F_ApiNewGraphicObject(), F_ApiNewAnchoredObject(), F_ApiNewElement()... but none to add an existing element...

 

Is there a way to do that ? If not is it possible to clone an object ?

Knowing result of XML export from ExtendScript

$
0
0

Does anyone have experience in tracking the status messages for an XML export from within ExtendScript ? One of my scripts publishes a book and all its chapters to XML and needs to report on possible errors that occurred. The export also includes running an XSLT for post processing. I can see the status messages in the console panel but I need to know the status from within the script, so that it can handle possible error situations elegantly.

 

Ciao

 

Jang


Call for more example scripts

$
0
0

Can someone post the following examples:

1. Loop through all paragraphs in a document and if the paragraph has a specific paragraph tag (e.g., Heading 1) change one aspect of the paragraph, for example, the text color. (This avoids the need to change the style and remove all the overrides.)

2. Loop through all the tables in a document and change one aspect of the table, for example the column width of the second column.

 

Thanks

Cross-Reference creation

$
0
0

Hello to all!

 

I am new to this amazing world of Extendscript but I have been using Framemaker since version 5.5.

 

I am working on a kind of cross-reference manager and it works really nice. I can list all cross-references at book or document level, select the cross-reference to be shown in the current document and so on. I am using non-structured FM.

 

The problem I am facing is the creation of cross-reference itself.I know how to create a Cross-Ref Marker for the Xref, but I don´t know how to insert the Xref into the content. I tried with NewAnchoredFormattedObject function with objType, format and textLoc parameters. Also there´s the XRefSrcText property (string containg unique ID:pgf_tag:text).

 

The question is: Should I use the same string (the content of XRefSrcText) as text for the Cross-Ref type Marker? Or just the pgf text that contains the Cross-Ref?

 

I have found several examples using Framescript but I am unable to replicate the code using ES.

 

Thanks for reading me. I will appreciate any help on this.

 

Regards

wrap toc book-component in toc via estk

$
0
0

Hi All,

I am trying to wrap a new toc book-component in the toc element via extendscript code and finding that the WrapElement function fails, as do fcodes.

 

Is this a bug or not implemented or am I missing something?

 

[Message moved to FM Scripting forum by moderator]

Input suppression for specifc XML nodes (structured FM document)

$
0
0

Hi,

 

Is there a way to suppress input or changes in specifc nodes (structured FM document)?

 

Thank you for any pointer.

 

Regards

 

Apollo102

Why is there no simple way to delete unused reference pages from multiple FM files?

$
0
0

I have hundreds of files in which some, but not all, of the reference pages are not being used. I don't want to open each file and manually click each page and then delete the pages one by one... what can I do to fix this? I think the files were all created with the same template but ironically the author imported graphics (by reference) onto the reference pages. The path to the referenced graphics (which are located on the reference pages) is invalid, and now all the FM files have errors. I am not a framemaker master, so this may be a simple fix, but I can't figure it out. I tried opening a file (file A) and deleting the unused reference pages. Then I saved it as a new file name (file B) and tried to import the reference pages of "file B" into "file A". This did not work. It just added additional reference pages to file A. I just want to be able to generate a list of reference pages for the files and then only delete the ones that I don't need. Please help. Any suggestions???

Viewing all 888 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>