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

FormatChangeList property integer value mystery

$
0
0

I am using ExtendScript to dynamically manipulate the formatting of a structured document. It's all working quite well except for one mystery...

 

Given an EDD that has a text formatting rule where the left indent is set to 0 mm. This will be stored in the associated FormatChangeList as an integer value of 0. That's fine, but the default value for all FormatChangeList properties is 0. So my question is, how does the EDD get generated to include only specific instances where a property value is set to 0?

fclEDD.png

In the DataBrowser we see this:

fclDataBrowser.png

String values are set to null and Objects can be tested using ObjectValid()...

 

I feel that there is a hidden mechanism that tells the FrameMaker formatting engine to use the value 0 when it is set in the EDD, but ignore it at all other times. That seems unlikely, so I think this must be a bug in the ExtendScript implementation and that the empty values should be null? is this odd behaviour the same via the FDK?

 

Thanks for any help

Ian


Creating new pgf object

$
0
0

Hello to everyone,

 

first of all: I am pretty new to FM and ExtendScript. I am integrating some old .mif files into existing FM documents with ExtendScript.

I am loading the needed parameters via propVal and using the method doc.Import().


Importing these .mif files works properly, but correctly aligning them is causing difficulties because I am not able place the files whereever I want.

As far as I see, there is no obvious ability to create and place a new pgf object in some specific place in the doc.

 

If that would be possible, before importing a .mif file, I certainly would create a new pgf object and import the .mif file right into it.

 

Is there a possibility to accomplish this, or do you guys know a better way to do so?
Thanks and king regards

Save As PDF (F_ApiSave) occasionally overwriting random PDFs

$
0
0

Our production environment is experiencing a random bug that is very difficult to reproduce. Every now and then (about 1 in 100), when our customised code saves out a PDF, it fails to create the PDF it was supposed to and instead overwrites a random PDF in the user's Documents folder, preserving only the filename. To be clear, nothing at all in our customised code goes anywhere near the Documents folder.

This is the snippet of code which saves the PDF:

 

FDKPropValsT setPDFVal = F_ApiGetSaveDefaultParams();
IntT iPropIndex = FDKApiGetPropIndex(&setPDFVal, FS_FileType);
setPDFVal.Val()[iPropIndex].propVal.u.ival = FV_SaveFmtPdf;
F_PropValsT *returnProps = NULL;
F_ObjHandleT savedDocId;
savedDocId = F_ApiSave(tgtBookId, PDFFileName, &setPDFVal, &returnProps);

 

Unfortunately due to the difficulty in reproducing this bug, I have not yet had it occur while debugging the program, so I haven't been able to inspect the input paramaters, returned doc id or return props when the bug occurs. However, I am confident the input parameters are correct, because I have tested changing tgtBookId to 0 and this is handled. Also as you will see in the proceeding screenshots, the correct PDFFileName is being passed to Distiller (nothing to do with Documents).

 

Calling the above code executes Distiller (presumably the FDK does this), which creates the PDF. This is what Distiller looks like when everything is normal and the PDF is created:

 

 

And this is what Distiller looks like when the bug occurs:

 

 

As you can see, the PDF File has .LOG extension instead of .pdf. What's more concerning though is the size of the source file is 0 bytes. I can only assume that the source file (S15_0322_v24.tps) is created by the FDK, because our customised code does not create this file, and the only thing we pass to F_ApiSave is the book id. I assume the FDK creates this temporary file based off the book id and passes it to Distiller, which makes me think this is a bug either with the FDK or with Distiller. The most concerning part of all however, is that even though the Distiller log says "No PDF produced", it has now actually overwritten a random PDF in the user's Documents folder! The PDF is automatically opened in Acrobat, which never happens when the correct PDF is made as in the first screenshot.

 

This has only started happening since we recently updated all of our hardware and software to the following:

 

Microsoft Surface Pro (2017)

Windows 10 Enterprise Version 1703 (64-bit)

Adobe FrameMaker 2017 Version 14.0.3.500

FDK 2017

Adobe Acrobat Pro 2017 Version 2017.011.30066

Adobe Acrobat Distiller Professional Version 17.11.30059238004

 

Previously we were running Windows 8, FrameMaker 11 and Acrobat Pro XI.

 

My questions are:

1) Is this issue familiar to anyone?

2) How is the temporary *.tps source file being created? Does the FDK create it? How is it getting a size of 0 bytes when this bug occurs?

3) When Distiller gets a source file with 0 bytes, how is it overwriting a random PDF in Documents with all the contents of the FrameMaker book? There is no mention of Documents in our customised code, or in the Distiller logs. Documents does however seem to be the default Save To path in Acrobat - the only correlation I can find, and the 'random' PDF happens to always be the last opened PDF in Acrobat.

 

I hope someone is able to help, as sooner or later it's going to overwrite someone's really important PDF.

How to clear and set a new string to a textframe ?

$
0
0

Hello forum.

 

A simple question that seems to be easy .

 

How to clear  a textframe and set à new string in it.

 

assuming this code :

 

if (textFrame.ObjectValid()) {

      if (textFrame.constructor.name === "TextFrame") {

         // how to clear the text inside the textframe

          // how to set the new string " new text in the textframe"

      }

    }

 

this text frame in on a reference page inside an unanchoredframe but i know how to get there.

 

thank you for your help

Orveo

FrameMaker Script to open readonly books

$
0
0

Hi,

Is it possible to open readonly books in FrameMaker using a script? I have tried the SimpleOpen(), Open() and the execute() methods and have not had any success. Any help would be appreciated, thanks.

 

I am currently using FrameMaker 12

Parameters to the Notify function

$
0
0

Dear friends and experts

In my script I have defined

  Notification (Constants.FA_Note_PostOpenDoc, true); 

And in the Notify function I normally get these parameters (logged):

Notify: iNote= 2    sParam= D:\_INFOBASE\general.fm    iParam= 0    object.Name=  D:\_INFOBASE\general.fm    object.ID=  67108877

(I use the object ID to check whether the document has really changed - which is not true in all cases).

But in rare cases I get iParam = 3, in which case the script runs havoc later on:

  • The document gets white and I can not see where I am (actions in the document are not possible, hence CTRL+L to make it visible is impossible).
  • The open palette still behaves in this current document (e.g. I can walk through the existing variables in the document)
  • I do not get any error messages in the log, ESTK is not opened to show me an error.
  • Closing the document via the X button is possible, but requires a second click after some time. Then the document is closed (after some time) and (if one exists) the next document (which is also white) can be closed. Finally I will close FM with the X, this creates an error and I need to kill FM. At the next open of FM the script is still registered and I need to unregister it, close FM and restart again for the next text.

  Where can I get a meaning from the the iParam = 3?

I thought this parameter is meaningful (!= 0) only for the FA_NotePreXxx / FA_NotePostXxx events as listed in the FDK Function Reference for F_ApiNotify().

 

Klaus

ESTK workspace not persistent anymore

$
0
0

Dear friends,

Since a while - propably an FM update - the selected workspace (DDD) is lost after closing ESTK CC (4.0.0.1, ES 4.5.5, ScriptUI 6.2.2).

At the next open of ESTK the selected workspace is briefly visible, but falls back into the Empty workspace, although in the dow-down-list it is selected. I need to reselect it.

 

I have checked the preferences - but can not find an appropriate setting.

Klaus

app.Displaying considered unreliable

$
0
0

Der friends,

The white document hits again... ( see https://forums.adobe.com/thread/2276988) and I tracked it down to failing app.Displaying. The script requests function SetDisplay (bWanted) 17 times successful, but the 18. call does not switch the display any more. The routine is that simple:

function SetDisplay (bWanted) { //=== Set display to on or off ====================================
// Arguments bWanted: true => set display ON; false => display OFF
// Commment  This function does not work reliably. See https://forums.adobe.com/thread/2276988
// Reference Rick Quattro    Console ("    current:" + app.Displaying + " => wanted: " + bWanted);  if (app.Displaying != bWanted) {    app.Displaying = bWanted;    Console ("    set ? " + app.Displaying);  }
} //--- end SetDisplay

Just after the following log the document gets white:

....SetDisplay(true)    current:0 => wanted: true    set ? 0

That is, app.Displaying was not performed and hence the document is not visible.

The white document appears within a routine which collects variables from the document. Since this function switches between pages and even page types I want to avoid flicker - which is really annoying here.

 

Do you spot something dubious in this routine?

 

function CollectVarsInDoc (oDoc, aDocVars) { //=== Collect variables in the 'natural' order =======
// Arguments oDoc:        current document
//           aDocVars:    array to be filled with var objects
// Called by xxx
// Calling   GetFindParameters, SetDisplay, SaveCurrentLocation, RestoreLocation
// Comment   Variables are found on all page types (Body, Master, Reference).
//           Starting points must be oDoc.FirstBodyPageInDoc, .FirstMasterPageInDoc, .FirstRefPageInDoc
var aVarsRange = [], bIsSystem, findParams, jFound = 0, jPageType, iVrLen, oFirst, oPage, oPara,    oSavedLoc, oTextItem,  oTR = new TextRange(), oVar, sVarName, sValue,    aPages = [oDoc.FirstBodyPageInDoc, oDoc.FirstMasterPageInDoc, oDoc.FirstRefPageInDoc];  SetDisplay (false);  oSavedLoc = SaveCurrentLocation (oDoc);  aDocVars.length = 0;                            // clear array for refill  if (oDoc == null) {                             // emergency bailing out       SetDisplay (true);    return;  }                for (jPageType = 0; jPageType < 3; jPageType++) { // for all page types    oFirst = aPages[jPageType];    if (oFirst.id == 0 && jPageType != 1) {continue}; // only master page(s) exist    oDoc.CurrentPage = oFirst;    oPage = oDoc.CurrentPage;    oPara = oPage.PageFrame.FirstGraphicInFrame.FirstPgf;    while (oPara == undefined) {                  // can happen on ref pages      oPage = oPage.PageNext;      if (oPage.id == 0) {        goFMv.nDocVars = aDocVars.length;        RestoreLocation (oDoc, oSavedLoc);        SetDisplay (true);        return;}                                  // no next page available      oPara = oPage.PageFrame.FirstGraphicInFrame.FirstPgf;    }    oTR   = oDoc.TextSelection;    oTR.beg.obj =  oTR.end.obj = oPara;    oDoc.TextSelection = oTR;    oTR.beg.offset = oTR.end.offset = 0;    findParams = GetFindParameters (2, null);     // finding any variable, no wrap    InitFA_errno ();                              // reset - it is write protected    oTR = oDoc.Find(oTR.beg, findParams);         // and do an initial find to get started.    while(FA_errno === Constants.FE_Success) {      jFound += 1;      oDoc.TextSelection = oTR;                   // set up the text range      aVarsRange = oDoc.GetTextForRange (oTR, Constants.FTI_VarBegin);  // this is an array      iVrLen = aVarsRange.length;                 // have not found anything other than 1 to be correct      if (iVrLen === 0) {                         // Hickup ?        InitFA_errno ();                          // track the progress        oTR = oDoc.Find(oTR.beg, findParams);     // prepare for next find        continue;                                 // while      }      oTextItem = aVarsRange[0];                  // have not found anything other than 1 to be correct      oVar = oTextItem.obj;      sVarName = oVar.VarFmt.Name;                // name of the variable      sValue   = oVar.VarFmt.Fmt;                 // contents of variable      oTR      = oVar.TextRange;                  // the text range of the variable      bIsSystem= (oVar.VarFmt.SystemVar !== Constants.FV_VAR_USER_VARIABLE);      aDocVars.push (new oVariable (sVarName, sValue, oVar, bIsSystem, oTR));      InitFA_errno ();                            // track the progress      oTR = oDoc.Find(oTR.beg, findParams);       // prepare for next find    }  }  goFMv.nDocVars = goFMv.aoDocVars.length;  RestoreLocation (oDoc, oSavedLoc);  SetDisplay (true);
} //--- end CollectVarsInDoc

 

From a more detailed trace I know that the statement on line 66 is in charge.


Open FrameMaker Application and Open a .fm Doc

$
0
0

Hello friends,

 

I want to implement following feature and wanted to ask, if you could help me accomplish this.

 

I want ExtendScript to open FrameMaker, every time the script is started.
After this, i want FrameMaker to open a specific .fm document - I have little experience in opening .mif files, so I think that opening files should not be a great problem.

 

 

But I have no idea, how to tell the script to start FM.


Thanks a lot!

 

 

Selim

How to display busy cursor or progress bar in FrameMaker Extendscript

$
0
0

Hi,

 

Is there a way to change the cursor to hour glass/busy, or display a progress bar.

 

Thank you in advance,

 

AZ

Deleting an xref format from a book

$
0
0

Hello fellows,

 

I need a framescript that deletes a specific xref format (e.g., "API") from a book. So I've decided to write one for the sake of practice.

 

I came up with the following code. When running it on a book, for some unclear reason it complains: "Missing Object on command (Loop) at Line (11). So far, it's unclear to me what the issue is. Any input will be appreciated!

 

If ActiveBook = 0

MsgBox 'There is no active book.';

LeaveSub;

Else

Set vCurrentBook = ActiveBook;

    Set vDoc = vCurrentBook.BookComponent;

EndIf

 

 

Loop ForEach(vDoc) In(vCurrentBook) LoopVar(vCompobj) //This is the line FM complains about.

    Open Document File(vCompobj.Name) NewVar(vDocObj) FileIsOldVersion FontNotFoundInDoc RefFileNotFound(AllowAllRefFilesUnFindable) AlertUserAboutFailure(false);

    Set vDocObj = ActiveDoc;

    Set vDocObj.ShowAll = 1;

    Set vXrefFmt = vDocObj.FirstXRefFmtInDoc;

    Loop While (vXrefFmt)

        If vXrefFmt.Name==='API'

            Set vXrefFmtToDelete = vXrefFmt;

            Delete Object(vXrefFmtToDelete);

            LeaveLoop;

        Else

            Set vXrefFmt = vXrefFmt.NextXRefFmtInDoc;

        EndIf

    EndLoop

    Save Document DocObject(vDocObj);

    Close Document DocObject(vDocObj);

EndLoop

One difference between FM10/11 and later FM versions

$
0
0

Dear all,

I want to inform you that there is a subtle difference in the Find function between scripts for FM-10/11 and the later FM versions.

See the relevant script part (function CollectVarsInDoc, line 50):

oTR = oDoc.Find(oTR.beg, findParams);     // prepare for next find

 

While this is OK in the newer FM version, in FM-10/11 it creates a loop at the first found variable.

For all FM version the following is correct:

oTR = oDoc.Find(oTR.end, findParams);     // prepare for next find

 

Klaus

Using Save() method to save as PDF

$
0
0

Hello everyone,

 

I am trying to save a FM-Doc as PDF and using the Save() method.

The method does not work correctly. I am getting no saved PDF file, and while execution I get a InvalidObject.
Could someone tell me, what the problem could be?
Here is the code:

 

function saveDocAsPDF(doc){
 var saveParams, name, i, baseName, status, fullName;
 name = doc.Name;
 fullName = "TESTPDF.pdf";
 saveParams = GetSaveDefaultParams();
 returnParams = new PropVals(); 
 var PDF = doc.Save(fullName, saveParams, returnParams);
 $.writeln("SaveReturnParams / Errors " + PrintSaveStatus(returnParams));
 i = GetPropIndex(returnParams, Constants.FS_SaveNativeError);   // CHECK STATUS
 status = returnParams[i].propVal.ival;
 if (status === Constants.FE_Success) {  return (true);
 } else {  return (false);
 }
};

 

 

And these are the properties set by me:

function getSaveDefaultParams(){
var params, i;       params = GetSaveDefaultParams();          i = GetPropIndex(params, Constants.FS_FileType);    params[i].propVal.ival = Constants.FV_SaveFmtPdf;    i = GetPropIndex(saveParams, Constants.FS_AlertUserAboutFailure);    saveParams[i].propVal.ival = true;    i = GetPropIndex(saveParams, Constants.FS_FileType);    saveParams[i].propVal.ival = Constants.FV_SaveFmtPdf;    i = GetPropIndex(saveParams, Constants.FS_FileIsInUse);    saveParams[i].propVal.ival = Constants.FV_ResetLockAndContinue;      i = GetPropIndex(saveParams, Constants.FS_SaveFileNotWritable);    saveParams[i].propVal.ival = Constants.FV_DoShowDialog;      return (params);
};

 

Thanks a lot!

ExtendScript - Change starting engine

$
0
0

Hello friends,

 

i am currenly working on customizing FrameMaker with ExtendScript.

When I completely restart ExtendScript Toolkit, I always have to change the "main engine" (don't know if this is the correct term) of my script

from "ExtendScript Toolkit CC" to "Adobe FrameMaker 2017" via this panel:
adobe_zielengine.png
Is there a way to modify the code, which implements this functionality automatically without user input as shown in the picture above?

 

Thanks a lot!

 

Selim

Import MIF files -> pgf problem?

$
0
0

Hello friends,

 

once more I have a question for you all.

 

I am importing .mif files with this function:

 

function render_file(file_path){     var doc = doc_GLOBAL;     var importFile = File(file_path);     var importParams = getImportPrefs();     var importReturnParams = new PropVals();     if(doc.ObjectValid()){          if(renderIndex == 0){     // Checking, if it is the first import. If so, use mainflowindoc, to get position               filePgf = doc.NewSeriesObject(Constants.FO_Pgf, doc.MainFlowInDoc);               }         else{                     // if not first import, create the new pgf after the old one               filePgf = doc.NewSeriesObject(Constants.FO_Pgf, filePgf);               }          }     var textLoc = new TextLoc();     textLoc.obj = filePgf;     textLoc.offset = 0 ;     var res = doc.Import(textLoc, file_path, importParams, importReturnParams);     renderIndex++;
};

 

After importing the mif files one by one, I can see them in the doc, but between all the imported mif docs , there is one additional pgf i don't want to appear, and don't know why it appears.

 

asasd.png

The first imported mif file is in the green box, the second one in the blue box. In between of them, the yellow-red area, is the pgf (so i guess?) I don't want to have.

Am I doing something wrong with my pgf objects while importing?

 

Hope you can answer that question!
Thanks

Selim


ExtendScript limit on how many paragraphs can be processed

$
0
0

I received a bug report on my FindChangeFormatsBatch ExtendScript script yesterday where the issue was a crash on two particular documents. Both documents contain a large amount of tables and, because each cell contains at least one paragraph, a large number of paragraphs. One document had over 12,000 paragraphs and the other over 14,200 paragraphs.

 

I still wasn't sure if the number of paragraphs was the problem so I set up a simple, Portrait document containing a large number of paragraphs. Each paragraph was empty except for an autonumber so I could keep track of the number of paragraphs. Here is the code I ran:

 

#target framemaker

var doc = app.ActiveDoc;
countPgfs (doc);

function countPgfs (doc) {
       var pgf, counter = 0;       pgf = doc.FirstPgfInDoc;    while (pgf.ObjectValid () === 1) {        counter += 1;        pgf = pgf.NextPgfInDoc;    }    alert (counter);
}

 

The code always ran the first time, even with over 14,000 paragraphs in the document. But it would hang and crash FrameMaker if I tried to run it a second time. I cut my paragraph count back until I could run it over and over without hanging. I ended up at around 12,200 paragraphs, give or take a few. Once I got over that mark, FrameMaker would hang on the second run of the script.

 

I wonder if anyone else has experimented with ExtendScript and processing large numbers of paragraphs. Any feedback or comments will be appreciated.

 

-Rick

does extendscript manage multidimessionnal array ?

$
0
0

hello forum.

 

i don't undestand why ES does not restitute correctly the data i input in the array.

 

i use the code of the export of "ExtendScript of the Week: Import and Export Variables "

i need to change the output . I want on one line all the variables for a same file .

so i add this  function to move from vertical to horizontal display. i send after  to a function that log in a file

 

function TransfertTo_DZG_Table(VariableData){
   
var tableVariableName= new Array("Model", "ManualType", "ManualNumber", "B_ChapterName","B_ChapterNumber", "B_SectionName", "B_SectionNumber","Item Number", "Item Name","Doc Status");   
    var tableFileName = new Array();
    var tableVariable =new Array();
    var VariableValue;
    tableVariable.variableCount = 0;

$.writeln ("longueur tableau="+VariableData.chapterNameArray.length);
   
     // table initialisation
      $.writeln ("--------------------start of table initialisation---------------------");
    for(boucle1=0;boucle1<VariableData.chapterNameArray.length;boucle1++){
        for(boucle2=0;boucle2<30;boucle2++){
              tableVariable[boucle1,boucle2]="---";             
              }
          }
      $.writeln ("--------------------end of table initialisation-----------------------");
    // end of initialisation
      
    // table filling
    $.writeln ("*************************start of filling******************");
//for(var i = 0; i < VariableData.chapterNameArray.length; i++){
     for(var i = 0; i < 50; i++){   // temporary to have less result
  
            var FileName=File(VariableData.chapterNameArray[i ]).displayName;
            var VariableName=VariableData.variableNameArray[i];
            var VariableValue=VariableData.variableDefArray[i ];
           
            var IndexFileName=GetIndexOf(tableFileName, FileName);
            var IndexVariableName=GetIndexOf(tableVariableName, VariableName);
           
           
            if(IndexFileName == -1){
                tableFileName.push(FileName);
               IndexFileName=GetIndexOf(tableFileName, FileName);
               $.writeln("nouveau fichier"+ FileName+"index nouveau fichier"+IndexFileName);
               }
            if(IndexVariableName== -1){
                tableVariableName.push( VariableName);
                IndexVariableName=GetIndexOf(tableVariableName, VariableName);
                }
            if(VariableValue===undefined){
                VariableValue="_";
                }
            tableVariable[IndexFileName,IndexVariableName]=VariableValue;
            $.writeln("-------tableVariable["+IndexFileName+","+IndexVariableName+"]="+VariableValue) ;
           
            }
        $.writeln ("*******************end of filling**********************");
// end of filling

// loop to check value inside  table
           $.writeln ("////////////////////////////check of the table//////////////////////////");
          for(boucle1=0;boucle1<5;boucle1++){
         $.writeln( "=============boucle1="+ boucle1+"============");
          for(boucle2=0;boucle2<10;boucle2++){
              $.writeln("tableVariable["+boucle1+","+boucle2+"]="+ tableVariable[boucle1,boucle2]);
             
              }
          }
      $.writeln ("////////////////////////////////////end of check///////////////////////////");
// end of loop    

//FcWriteTableau(tableVariable);
//ExtractTableau(tableFileName,tableVariableName,tableVariable);

 

 

and here the console output :

in paragraph "check the table" the loop  repeat each time the last ten variables.

 

 

 

entre dans ExportVariable

longueur tableau=105

--------------------start of table initialisation---------------------

--------------------end of table initialisation-----------------------

*************************start of filling******************

nouveau fichierTitlePage_FAA_MDDG.fmindex nouveau fichier0

-------tableVariable[0,10]=XXXXXX

-------tableVariable[0,11]=The xxxxxxx Company

-------tableVariable[0,12]=Title Template

-------tableVariable[0,5]=Preface

-------tableVariable[0,6]=E

-------tableVariable[0,3]=Title Page_DZG

-------tableVariable[0,4]=1

-------tableVariable[0,13]=14

-------tableVariable[0,0]=123

-------tableVariable[0,14]=2017

-------tableVariable[0,2]=A630Z004-01

-------tableVariable[0,15]=2013

-------tableVariable[0,9]=

-------tableVariable[0,16]=Dispatch Deviations Guide (DDG)

-------tableVariable[0,1]=Dispatch Deviations Guide

-------tableVariable[0,17]=Jul 20, 2017

nouveau fichierP-00-00TOC.fmindex nouveau fichier1

-------tableVariable[1,1]=Dispatch Deviations Guide

-------tableVariable[1,7]=00

-------tableVariable[1,9]=

-------tableVariable[1,2]=B630Z004-02

-------tableVariable[1,0]=456

-------tableVariable[1,3]=Section List_V

-------tableVariable[1,5]=Preface_V

-------tableVariable[1,6]=E

-------tableVariable[1,17]=Jul 20, 2017

nouveau fichierP-00-01-00_FAA.fmindex nouveau fichier2

-------tableVariable[2,1]=Dispatch Deviations Guide

-------tableVariable[2,18]=10

-------tableVariable[2,9]=

-------tableVariable[2,13]=14

-------tableVariable[2,2]=C630Z004-03

-------tableVariable[2,19]=14

-------tableVariable[2,0]=789

-------tableVariable[2,7]=00-01-00

-------tableVariable[2,3]=Revision Record_V

-------tableVariable[2,5]=Preface_V

-------tableVariable[2,6]=E

-------tableVariable[2,20]=Rev Rec

-------tableVariable[2,21]=D630Z004-01

-------tableVariable[2,22]=XX

-------tableVariable[2,23]=D630Z004-XXX

nouveau fichier4-00-00TOC.fmindex nouveau fichier3

-------tableVariable[3,1]=Dispatch Deviations Guide

-------tableVariable[3,0]=963

-------tableVariable[3,2]=D630Z004-01

-------tableVariable[3,20]=General_V

-------tableVariable[3,6]=H

-------tableVariable[3,7]=00

-------tableVariable[3,5]=Miscellaneous_V

-------tableVariable[3,9]=

-------tableVariable[3,17]=Jul 20, 2017

nouveau fichier4-00-01-00.fmindex nouveau fichier4

-------tableVariable[4,19]=MML Revision Number

*******************end of filling**********************

////////////////////////////check of the table//////////////////////////

=============boucle1=0============

tableVariable[0,0]=963

tableVariable[0,1]=Dispatch Deviations Guide

tableVariable[0,2]=D630Z004-01

tableVariable[0,3]=Revision Record_V

tableVariable[0,4]=1

tableVariable[0,5]=Miscellaneous_V

tableVariable[0,6]=H

tableVariable[0,7]=00

tableVariable[0,8]=---

tableVariable[0,9]=

=============boucle1=1============

tableVariable[1,0]=963

tableVariable[1,1]=Dispatch Deviations Guide

tableVariable[1,2]=D630Z004-01

tableVariable[1,3]=Revision Record_V

tableVariable[1,4]=1

tableVariable[1,5]=Miscellaneous_V

tableVariable[1,6]=H

tableVariable[1,7]=00

tableVariable[1,8]=---

tableVariable[1,9]=

=============boucle1=2============

tableVariable[2,0]=963

tableVariable[2,1]=Dispatch Deviations Guide

tableVariable[2,2]=D630Z004-01

tableVariable[2,3]=Revision Record_V

tableVariable[2,4]=1

tableVariable[2,5]=Miscellaneous_V

tableVariable[2,6]=H

tableVariable[2,7]=00

tableVariable[2,8]=---

tableVariable[2,9]=

=============boucle1=3============

tableVariable[3,0]=963

tableVariable[3,1]=Dispatch Deviations Guide

tableVariable[3,2]=D630Z004-01

tableVariable[3,3]=Revision Record_V

tableVariable[3,4]=1

tableVariable[3,5]=Miscellaneous_V

tableVariable[3,6]=H

tableVariable[3,7]=00

tableVariable[3,8]=---

tableVariable[3,9]=

=============boucle1=4============

tableVariable[4,0]=963

tableVariable[4,1]=Dispatch Deviations Guide

tableVariable[4,2]=D630Z004-01

tableVariable[4,3]=Revision Record_V

tableVariable[4,4]=1

tableVariable[4,5]=Miscellaneous_V

tableVariable[4,6]=H

tableVariable[4,7]=00

tableVariable[4,8]=---

tableVariable[4,9]=

////////////////////////////////////end of check///////////////////////////

Résultat : undefined

 

So how do you manage multidimensionnal array

i can't do like "extend of the week " as i don't know number of variables nor number of files.

thank

Is there a Framemaker Extendscript object model?

$
0
0

I am looking for any information on this topic. I have used FM for decades, but never delved into scripting. Now that I wish to do so, I find that all sorts of Adobe products have object models available, but there does not seem to be anything for FM. I am very new to scripting, as well, so perhaps I am not even asking the right question?

 

Please assist, if you can?

FrameMaker: FDK or Extendscript how to capture keyboard input

$
0
0

I am writing an plugin for Framemaker that needs to capture text as it is entered by the user dynamically in order to check if any similar segments have already been entered using an author memory database. Is there any way that I can do this using the Framemaker FDK or Extendscript? Looking at the documentation there is no obvious way of doing this.

Thank you in advance

Programmatic copy vs. manual copy

$
0
0

What is the hidden secret here?

  1. The script is copied from a desktop-subdirectory into FrameMaker Startup by mans of an installation program.
  2. The script is manually copied (using File explorer) from the desktop-subdirectory into FrameMaker Startup.

Starting FM after case 1 executes the script twice !

Starting FM after case 2 executes (as expected) the script once.

I have cut down my script to something manageable and did the tests with this stub.

 

// FMdict_test.jsx ------ UTF-8 ------------------------------------------------------------------------
#target framemaker
ShowDictInfo ()                                   // At start of FM inform about the User dictionary
SetUpMenus()    // inactivate for debugging       // Establish menu item to get the information also later.

function SetUpMenus() { // =========================================================================
// This function MUST NOT be named DefineMenu - because this is a reserved function!
  var sDictMenu  = "Dictionary information";  var sShortLbl  = "ESC q d i";  var sShortCut  = "\\!qdi";  var menuLocation = app.GetNamedMenu("FileMenu");   var cmdDoc       = menuLocation.DefineAndAddCommand(1, "FMdict_DocInfo", sDictMenu, sShortCut);  cmdDoc.KeyboardShortcutLabel = localize(sShortLbl);    UpdateMenus();                                  // refresh and actually make the new menu appear  
} // ---  end SetUpMenus

function Command(cmd){
  switch(cmd) {    case 1:     ShowDictInfo();     break;  }
} // --- end Command

function ShowDictInfo () { // === Alert the dictionary information ================================
var appdata    = app.UserSettingsDir;             // %appdata%\Adobe\FrameMaker\<version>
var FMdictDir  = appdata.replace (/Adobe.*/ , "D+DD\\FMdict");
var iniFile    = FMdictDir + "\\scripts\\FMdict.ini";
var title      = "FMdict — Dictionary information";
var currentPrj = "current Project"                // GetIniValue (iniFile, "currentPrj");
var currentDir = "current Directory"              // GetIniValue (iniFile, "currentDir");
var text       = "The User dictionary was loaded from \nFMdict project:\t" + currentPrj + "\nLocated in:  \t" + currentDir;  if (currentPrj !== "NONE") {                    // must fit with FMdict    alert (text, title, false);  }
}

 

the installation routine is a compiled AHK (AutoHotKey) script which uses this statement:

  FileCopy, %installDir%\scripts\*.jsxbin, %FMtarget%, 1

This expands to

  FileCopy, C:\Users\Klaus\Desktop\InstallThis\scripts\*.jsxbin, C:\Users\Klaus\AppData\Roaming\Adobe\FrameMaker\14\Startup, 1

Parameter 1 allows to overwrite an existing file.

 

After deleting the target file I repeated the experiment with the command prompt:

Copy C:\Users\Klaus>copy C:\Users\Klaus\Desktop\InstallThis\scripts\*.jsxbin C:\Users\Klaus\AppData\Roaming\Adobe\FrameMaker\14\Startup

This copied script also hits twice!

 

Find the jsxbin here - it shoud be the same if you 'Export as Binary' the above script.

 

A very bewitched situation...

Klaus

Viewing all 888 articles
Browse latest View live


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