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

Where is the script for flattening conrefs? Not in my sample scripts folder

Explorer ,
Dec 16, 2011 Dec 16, 2011

Copy link to clipboard

Copied

Hi,

Sure is hard to find out anything about Extendscript.  I googled and saw several sites that mentioned a number of scripts that were supposed to come with FM10.  I only have six:

AddTableHighlighting

AlignAnchoredFrame

RemoveTableHighlighting

SaveAsFM8

SaveAsFM8_Event

UnlockLockTextInsets

I'm looking for the one to flatten conrefs.  Thanks!

TOPICS
Scripting

Views

1.7K

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

correct answers 1 Correct answer

Explorer , Dec 17, 2011 Dec 17, 2011

Duh! Thanks, Ian.

Votes

Translate

Translate
Enthusiast ,
Dec 16, 2011 Dec 16, 2011

Copy link to clipboard

Copied

On my Windows 7 system the scripts are here:

C:\Program Files (x86)\Adobe\AdobeFrameMaker10\Samples\ScriptsAndUtilities\Flatten Conrefs

Ian

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
Explorer ,
Dec 17, 2011 Dec 17, 2011

Copy link to clipboard

Copied

Duh! Thanks, Ian.

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
Explorer ,
Dec 17, 2011 Dec 17, 2011

Copy link to clipboard

Copied

Okay, thanks to Ian I have now found the script to flatten a conref.  Has anyone used this script?  I am very new at this and wonder how this all works.  Here are my questions:

Do I just open a book or xml file and then select File > Script > Run and then select the flattenconref.jsx file? I don't see anything happening when I do this.  There's no confirmation that anything has run or been accomplished.

Even more disturbing, when I select this conref from the script library, only asterisks display in the description box.  Is that normal?

My understanding from the small amount of information that exists about flattening conrefs is that I no longer have to have the conrefs open in the background for them to display in my book file.  However, if I flatten a conref, it ceases to act like a conref.  Is my understanding correct?

If anyone has any resources that can help me understand scripting better, please let me know.

As always, thanks in advance for any assistance.

Mary

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
Enthusiast ,
Dec 17, 2011 Dec 17, 2011

Copy link to clipboard

Copied

When you run the script it will create a new DitaUtility menu. This has two commands:

  • Flatten conrefs in topicrefs
  • Flatten conrefs in ditamap

If you click Move to AutoRun from the script library dialog, the new menu will be available each time you start FrameMaker.

The Asterisks are the first part of the commented section at the start of the file. It's nothing to worry about! It would be more helpful if Adobe put useful comments in the script files...

The best resources for getting to grips with FrameMaker scripting are some really good books such as "JavaScript: The definitive guide" and "JavaScript: The Good Parts" both published by O'Reilly. The FDK developer's guide is the best place to learn about programming FrameMaker. While the Scripting guide is now available from the help system's home page.

Also Debra Herman has the Extending FrameMaker blog at http://extendingframemaker.blogspot.com/

Enjoy your scripting!

Ian

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
Explorer ,
Dec 18, 2011 Dec 18, 2011

Copy link to clipboard

Copied

Okay, Ian, it’s becoming a little clearer. One more question though.

By clicking Move to AutoRun, the script will automatically flatten conrefs in both topicrefs and ditamaps?

Thanks so much for your help.

Mary

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
Enthusiast ,
Dec 19, 2011 Dec 19, 2011

Copy link to clipboard

Copied

Hi Mary,

No, the Move to Auto Run will simply copy the script into the startup folder. That means you don't have to run the script manualy to see the DitaUtility menu. You will always need to select the relevant menu command to flatten any conrefs.

Ian

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
Explorer ,
Dec 20, 2011 Dec 20, 2011

Copy link to clipboard

Copied

Ian,

Every time I open up FM now, I get the following Script Error Message:

Error in C:\Documents and Settings\mgreer1\Application Data\Adobe\FrameMaker\10\startup\FM_Flatten_Conrefs.jsx

Line 23: #include “FM_lib.jsx”

File or folder does not exist

What does this mean?

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
Enthusiast ,
Dec 20, 2011 Dec 20, 2011

Copy link to clipboard

Copied

I think you have found a weakness in the Move to AutoRun feature. The Flatten conrefs script also needs the included FM_lib.jsx file to be in the startup folder. You can copy this manually from the ScriptsAndUtilities\Flatten Conrefs folder into the startup folder.

The error message tells you that on line 23 of the script there is an #include directive that points to the FM_lib.jsx file (which contains further parts of the script).

Ian

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
Explorer ,
Dec 20, 2011 Dec 20, 2011

Copy link to clipboard

Copied

LATEST

You’re a peach, Ian. Thanks for the many Christmas presents – and early too!

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