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

Select textframe in framemaker.

Community Beginner ,
Apr 27, 2018 Apr 27, 2018

Copy link to clipboard

Copied

How do I select all text frames in framemaker using extendscript ?

TOPICS
Scripting

Views

766

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 Expert ,
Apr 27, 2018 Apr 27, 2018

Copy link to clipboard

Copied

What is the overall thing you are trying to accomplish?

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 ,
Apr 27, 2018 Apr 27, 2018

Copy link to clipboard

Copied

Hi ,

I need to add and remove textframe in framemaker when page zoom and fit in page window process,and i want to move the textframe in page of the bottom in framemaker using extendscript.So please suggests if any ideas.

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 Expert ,
Apr 27, 2018 Apr 27, 2018

Copy link to clipboard

Copied

With ExtendScript, you don't really have to select a text frame to move it like you do in the interface. If you get the TextFrame object in a variable, you can change its LocX, LocY, Width, and Height properties to move it and resize it.

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 Expert ,
Apr 27, 2018 Apr 27, 2018

Copy link to clipboard

Copied

Here is how you can add a text frame to the current page:

#target framemaker

// Get the active document object.

var doc = app.ActiveDoc;

// Define variables.

var page, textFrame;

// Get the current page.

page = doc.CurrentPage;

// Add a text frame to the page.

textFrame = doc.NewTextFrame (page.PageFrame);

// "Mark" the text frame so you can find it later.

textFrame.Flow.Name = "zoom_frame";

// Use the LocX, LocY, Width, and Height properties

// to position and resize the text frame.

// ...

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 Expert ,
Apr 27, 2018 Apr 27, 2018

Copy link to clipboard

Copied

LATEST

Here is how you can find the text frame you added earlier and delete it:

#target framemaker

var doc = app.ActiveDoc;

var page, textFrame;

// Set a variable for the current page.

page = doc.CurrentPage;

// Try to find the text frame with the "zoom_frame" text flow.

textFrame = getTextFrame (page, "zoom_frame");

// If the text frame is found, delete it.

if (textFrame) {

    textFrame.Delete ();

}

function getTextFrame (page, flow) {

   

    // This function will find a text frame that

    // has a specified flow name on the page.

   

    var graphic;

   

    graphic = page.PageFrame.FirstGraphicInFrame;

    while (graphic.ObjectValid () === 1) {

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

            if (graphic.Flow.Name === flow) {

                return graphic;

            }

        }

        graphic = graphic.NextGraphicInFrame;

    }

}

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