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

Is there a script to keep text frame under the page no matter the page size?

Advisor ,
Jan 28, 2019 Jan 28, 2019

Is there a way to keep a text frame .5" away from the bottom of the page? I currently have a script that can do this however you have to alter it for every page size. We use tons of different page sizes and it would be way easier if the script could determine all this for me and automatically place it at the bottom.

//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>CREATE TEXT FRAME FOR SAVE INFO<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\\

    function addTextFrame(doc, layer, name){ 

        var myBlendingSettings = { blendMode : BlendMode.OVERLAY };       

        var myTransparencySettings = { blendingSettings : myBlendingSettings };    

         

        var tf = doc.textFrames.itemByName(name); 

        if(tf && tf.isValid) {       

            tf.remove(); 

        } 

        var origUnit = app.scriptPreferences.measurementUnit;      

        app.scriptPreferences.measurementUnit = MeasurementUnits.INCHES;

        tf = doc.textFrames.add(layer, LocationOptions.UNKNOWN, {name: name, fillColor :"Yellow", fillTint: 20, transparencySettings : myTransparencySettings,

            geometricBounds: ['12.55','0','11.5','4.5'] });        

        app.scriptPreferences.measurementUnit = origUnit;     

              return tf; 

    } 

Screen Shot 2019-01-25 at 11.09.10 AM.jpg

TOPICS
Scripting
468
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

Community Expert , Jan 28, 2019 Jan 28, 2019

Try the following

function addTextFrame(doc, layer, name){   

        var myBlendingSettings = { blendMode : BlendMode.OVERLAY };         

        var myTransparencySettings = { blendingSettings : myBlendingSettings };      

           

        var tf = doc.textFrames.itemByName(name);   

        if(tf && tf.isValid) {         

            tf.remove();   

        }   

        var origUnit = app.scriptPreferences.measurementUnit;        

        app.scriptPreferences.measurementUnit = MeasurementU

...
Translate
Community Expert ,
Jan 28, 2019 Jan 28, 2019

Try the following

function addTextFrame(doc, layer, name){   

        var myBlendingSettings = { blendMode : BlendMode.OVERLAY };         

        var myTransparencySettings = { blendingSettings : myBlendingSettings };      

           

        var tf = doc.textFrames.itemByName(name);   

        if(tf && tf.isValid) {         

            tf.remove();   

        }   

        var origUnit = app.scriptPreferences.measurementUnit;        

        app.scriptPreferences.measurementUnit = MeasurementUnits.INCHES; 

        tf = doc.textFrames.add(layer, LocationOptions.UNKNOWN, {name: name, fillColor :"Yellow", fillTint: 20, transparencySettings : myTransparencySettings});

tf.geometricBounds = [doc.pages[0].bounds[2] + .5, 0, doc.pages[0].bounds[2] + 1.55, 4.5]

        app.scriptPreferences.measurementUnit = origUnit;       

        return tf;   

    }

-Manan

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
Advisor ,
Jan 28, 2019 Jan 28, 2019
LATEST

Thank you very much. This is is perfect.

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