6 Replies Latest reply on May 31, 2016 10:18 AM by Kai Rübsamen

    How can i make this fill 50%?

    cbishop01 Level 2
      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

        • 1. Re: How can i make this fill 50%?
          Kai Rübsamen Adobe Community Professional

          Try it with two steps:

           

          var tempFrameProps = {
              name: frameName,
              contents: contentsOfFrame,
              fillColor: "Yellow",
              fillTint: 60,
              geometricBounds: ["-0.75in","-4.45in",".5in","-.75"] 
          }
          

           

          Kai

          1 person found this helpful
          • 2. Re: How can i make this fill 50%?
            cbishop01 Level 2

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

            • 3. Re: How can i make this fill 50%?
              cbishop01 Level 2

              Thank you again. 

              • 4. Re: How can i make this fill 50%?
                cbishop01 Level 2

                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.

                • 5. Re: How can i make this fill 50%?
                  Laubender Adobe Community Professional & MVP

                  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

                  1 person found this helpful
                  • 6. Re: How can i make this fill 50%?
                    Kai Rübsamen Adobe Community Professional

                    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});