• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to suppress "not in the paragraph catalog"

Community Beginner ,
Mar 07, 2012 Mar 07, 2012

Copy link to clipboard

Copied

I have a script to generate HTML below. This works, however some documents create the "Paragraph tag ... is not in the Paragraph Catalog" dialog.  I need the script to not require any input, so how can this be suppressed, or push all items into the catalog before saving? 

Also I haven't seen it yet, but suspect similar issues could occur with tables and characters not in the catalog.

Alternatively, something that can intercept dialogs and hit "ok" would work.

Thanks

function saveCsrHTML(doc, suffix) {

    var saveDirname = doc.Name.substr(0, doc.Name.lastIndexOf("\\"));

    var saveBasename = basename(doc.Name);

    var params = GetSaveDefaultParams();

    var i = GetPropIndex(params, Constants.FS_FileType);

    params.propVal.ival = Constants.FV_SaveFmtFilter;

    var i = GetPropIndex(params, Constants.FS_SaveFileTypeHint);

    params.propVal.sval ="0001ADBEHTML";

    var i = GetPropIndex (params, Constants.FS_SaveMode);

    params.propVal.ival  = Constants.FV_ModeSaveAs;

    var i = GetPropIndex (params, Constants.FS_RetainNameStripe);

    params.propVal.ival  = 0;

    var i = GetPropIndex(params, Constants.FS_AlertUserAboutFailure);

    params.propVal.ival = false;

    var returnParamsp = new PropVals();

    var filename = saveDirname + "\\" + saveBasename + suffix + ".html";

    doc.Save(filename, params, returnParamsp);

}

TOPICS
Scripting

Views

1.4K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 08, 2012 Mar 08, 2012

Copy link to clipboard

Copied

Hi,

Please visit the following blog for information to suppress a particular FM alert:

http://blogs.adobe.com/techcomm/2012/02/extendscript-of-the-week-suppressing-a-specific-fm-alert.htm...

Regards,

Saurabh

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 09, 2012 Mar 09, 2012

Copy link to clipboard

Copied

There are tools (Plug-ins and ExtendScripts) for FrameMaker 5 - 10 available to delete unused, all ... (free)
and rename formats (e.g. not in Catalog) to other.

- Georg

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 10, 2012 Mar 10, 2012

Copy link to clipboard

Copied

> Please visit the following blog for information to suppress a particular FM alert:

http://blogs.adobe.com/techcomm/2012/02/extendscript-of-the-week-suppr essing-a-specific-fm-alert.ht...

I saw that, but this message includes the paragraph name, and that posting says the message must match exactly.  Perhaps framemaker 11 could accept "*" wildcards?

>There are tools (Plug-ins and ExtendScripts) for FrameMaker 5 - 10 available to delete unused, all ... (free)

>and rename formats (e.g. not in Catalog) to other.

Can you point to one?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 10, 2012 Mar 10, 2012

Copy link to clipboard

Copied

Hi,

You can use regular expressions in ExtendScript to make it work for a particular pattern.

Regards,

Saurabh

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 12, 2012 Mar 12, 2012

Copy link to clipboard

Copied

Thanks for sticking with me!

>You can use regular expressions in ExtendScript to make it work for a particular pattern.

That logically makes sense, however when I run the whole thing below as a script the callback is never activated. But, if I then manually File->Save As->HTML it works correctly.   What am I missing?

alert("Loading script");

Notification(Constants.FA_Note_Alert,true); //Registering for the event  FA_Note_Alert

saveHTML(app.ActiveDoc, "foobar.html");

function Notify(note,doc,sparm,iparm) {

    switch (note) {

    case Constants.FA_Note_Alert :

        alert("notify callback "+sparm);

        if (/Paragraph tag .* is not in the Paragraph Catalog.*/i.test(sparm)) {

            ReturnValue(Constants.FR_YesOperation)

        }

        break;

    }

}

function saveHTML(doc, filename) {

    var params = GetSaveDefaultParams();

    var i = GetPropIndex(params, Constants.FS_FileType);

    params.propVal.ival = Constants.FV_SaveFmtFilter;

    var i = GetPropIndex(params, Constants.FS_SaveFileTypeHint);

    params.propVal.sval ="0001ADBEHTML";

    var i = GetPropIndex (params, Constants.FS_SaveMode);

    params.propVal.ival  = Constants.FV_ModeSaveAs;

    var i = GetPropIndex (params, Constants.FS_RetainNameStripe);

    params.propVal.ival  = 0;

    var i = GetPropIndex(params, Constants.FS_AlertUserAboutFailure);

    params.propVal.ival = false;

    var returnParamsp = new PropVals();

    Err("Saving HTML "+filename+"...\n");

    doc.Save(filename, params, returnParamsp);

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 12, 2012 Mar 12, 2012

Copy link to clipboard

Copied

Hi,

Do you see any errors in the FM console window?

Regards,

Saurabh

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 13, 2012 Mar 13, 2012

Copy link to clipboard

Copied

LATEST

The framemaker console has the print messages my script makes:

Saving HTML R:\....html...

The javascipt console in the debug window is empty.

I get the "loading script" alert, but not the "notify callback" alert.

After running the above, without reloading the script, the manual "Save As" works and I get the notify callback. So obviously it is being installed the first time, just not called.  If I run the script a second time in the same session it still doesn't work, so it's not a matter of it being installed too late or something like that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines