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

Fetching AFrame for each page

$
0
0

Hi,

 

I want to fetch all Aframes information in an active doc whose layout has three columns for each page.

 

WS000001.jpeg

 

 

 

 

I wrote the code below:

 

#target framemaker 

var doc = app.ActiveDoc;

if (doc.ObjectValid() == true) {

    var page = doc.FirstBodyPageInDoc;

    while (page.ObjectValid()) {

        var graFrame = page.PageFrame.FirstGraphicInFrame;

        while (graFrame.ObjectValid()) {

            var subcol = graFrame.FirstSubCol;

            while (subcol.ObjectValid()) {

                var aFrame = subcol.FirstAFrame;

                while (aFrame.ObjectValid()) {

                    alert(page.PageNum + " " + aFrame.Width); // display Info about Aframe

                    aFrame = aFrame.NextAFrame;

                }

                   subcol = subcol.NextSubCol;

            }

            graFrame = graFrame.NextGraphicInFrame;

        }

        page = page.PageNext;

    }

}

 

 

This code does not work correctly.

Alert message like below;

-----------------------------

0 1000

0 2000

1 2000

-----------------------------

 

 

The second alert, "0 2000" is undesirable, because this information about Aframe on page 1.

"var subcol" ignores the page.

 

 

Could you teach me how to fix it, please?

 

 

Thanks,

Koji Koike


Viewing all articles
Browse latest Browse all 888

Trending Articles



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