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

left side of frame to left page margin and right side of frame to right page margin

Participant ,
Sep 26, 2014 Sep 26, 2014

like the one pictured on the right - right, on the left - left, portable Image_10.jpg

TOPICS
Scripting
462
Translate
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

Enthusiast , Sep 26, 2014 Sep 26, 2014

Hi,

below code may help you,

var myDoc = app.activeDocument;

myDoc.documentPreferences.facingPages = false; 

myDoc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;

myDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;

var width = myDoc.documentPreferences.pageWidth;

var height = myDoc.documentPreferences.pageHeight;

for(var p=0; p<myDoc.pages.length; p++)

{

    for(var i =0;i<myDoc.pages

.textFrames.length;i++) 

    { 

        myPage = app.activeWindow.a

...
Translate
Community Expert ,
Sep 26, 2014 Sep 26, 2014

You'll have to do some more explaining if you want an answer.

Peter

Translate
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
Participant ,
Sep 26, 2014 Sep 26, 2014

middle of the page with reference to right objects right edge left objects lower edge

Is it possible to move

Image_11.jpg

Translate
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 ,
Sep 26, 2014 Sep 26, 2014

Hi,

below code may help you,

var myDoc = app.activeDocument;

myDoc.documentPreferences.facingPages = false; 

myDoc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;

myDoc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;

var width = myDoc.documentPreferences.pageWidth;

var height = myDoc.documentPreferences.pageHeight;

for(var p=0; p<myDoc.pages.length; p++)

{

    for(var i =0;i<myDoc.pages

.textFrames.length;i++) 

    { 

        myPage = app.activeWindow.activePage;

        var myLeftMargin = myPage.marginPreferences.left;

        var myRightMargin = myPage.marginPreferences.right;

        var liveArea = width-myLeftMargin-myRightMargin;

        var myFrame = myDoc.pages

.textFrames;

        var gBounds = myFrame.geometricBounds;

        var myTextFrameWidth = gBounds[3]-gBounds[1];

        myFrame.select();

        if(gBounds[1]<(liveArea/2))

        {

            myFrame.move([myFrame.parentPage.marginPreferences.left, gBounds[0]]); 

        } 

        else 

        { 

            myFrame.move([(width-myRightMargin-myTextFrameWidth), gBounds[0]]); 

        } 

    }

myDoc.documentPreferences.facingPages = true; 

Vandy

Translate
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
Participant ,
Sep 27, 2014 Sep 27, 2014
LATEST

thank you very much this magnificent

I want to on the right object distribute vertical centers and on the left object distribute vertical centersImage_13.jpg

Translate
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