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

How can i make this fill 50%?

Advisor ,
May 27, 2016 May 27, 2016

var tempFrameProperties = 

     { 

        name : frameName , 

        contents : contentsOfFrame , 

        fillTint : ("Yellow", 60.0), // How can i make this a 60%fill?

        geometricBounds : ["-0.75in","-4.45in",".5in","-.75"]  

        } 

Im trying to make this a 60% fill of Yellow.  I've tried about

TOPICS
Scripting
560
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 , May 27, 2016 May 27, 2016

Try it with two steps:

var tempFrameProps = {

    name: frameName,

    contents: contentsOfFrame,

    fillColor: "Yellow",

    fillTint: 60,

    geometricBounds: ["-0.75in","-4.45in",".5in","-.75"]

}

Kai

Translate
Enthusiast ,
May 27, 2016 May 27, 2016

Try it with two steps:

var tempFrameProps = {

    name: frameName,

    contents: contentsOfFrame,

    fillColor: "Yellow",

    fillTint: 60,

    geometricBounds: ["-0.75in","-4.45in",".5in","-.75"]

}

Kai

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 ,
May 27, 2016 May 27, 2016

Thank you for your reply I'll try this when I get back to work

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 ,
May 31, 2016 May 31, 2016

Thank you again. 

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 ,
May 31, 2016 May 31, 2016

How can i put an overlay?  i've tried the below and its not working.

var tempFrameProperties = 

     { 

        name : frameName , 

        contents : contentsOfFrame , 

        fillColor: "Yellow",

        fillTint: 20,

        BlendMode: OVERLAY,

and

blendingMode: overlay,

Neither are working.  I've also tried transparencyMode: overlay.

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
Community Expert ,
May 31, 2016 May 31, 2016

This case is a bit more complicated as you'd like perhaps.

First read my comments in the code snippet, then run it with and without the last line of code:

// All not declared properties fall back to default or actual user settings.

// Debug well!

// Sometimes some properties cannot be declared in the construction process with method add()

// and must be applied AFTER adding the text frame!!

var myBlendingSettings = { blendMode : BlendMode.OVERLAY };

var myTransparencySettings = { blendingSettings : myBlendingSettings };

var tempFrameProperties =  

{  

    geometricBounds : [0,0,"100mm","100mm"] , // Allowed: a mixture of numbers and strings

    name : "MyFrameName" ,  

    contents : "Hello World" ,  

    fillColor: "Yellow",  // WARNING: Generic CMYK color

    fillTint: 20,

    transparencySettings : myTransparencySettings

}

// ADD A DOCUMENT:

// A lot of default properties are used for adding a document,

// since no properties are declared explicitely!

var doc = app.documents.add();

// ADD A TEXTFRAME TO THAT DOCUMENT:

// Text frame will be automatically be added to spread one.

// Hm. Will all the properties are applied right now?

var tempFrame = doc.textFrames.add

(

    {

        properties : tempFrameProperties

    }

);

// ** IMPORTANT **

// TEST WITH AND WITHOUT USING THE LINE OF CODE BELOW:

tempFrame.properties = tempFrameProperties;

You decide, if you are better using the point notation for applying properties with their values or e.g. the properties property for applying more than one property plus values at the same time using an object.

Uwe

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 ,
May 31, 2016 May 31, 2016
LATEST

Hm! It seems, that 'properties' ist not honored inside of 'add' ??

This works:

var tf = app.selection[0];

var frameName = "My tFrame";

var contentsOfFrame = "Hello World!";

var tempFrameProps = {

  name: frameName,

  contents: contentsOfFrame,

  fillColor: "Yellow",

  fillTint: 20,

  transparencySettings: {

    blendingSettings: {

      blendMode: BlendMode.OVERLAY

    }

  }

}

tf.properties = tempFrameProps;

var tFrame = app.activeDocument.textFrames.add({

  name: frameName,

  contents: contentsOfFrame,

  fillColor: "Yellow",

  fillTint: 20,

  transparencySettings: {

    blendingSettings: {

      blendMode: BlendMode.OVERLAY

    }

  }

});

This create only a textframe with no additional properties:

app.activeDocument.textFrames.add({properties: tempFrameProps});

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