Copy link to clipboard
Copied
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
Try it with two steps:
var tempFrameProps = {
name: frameName,
contents: contentsOfFrame,
fillColor: "Yellow",
fillTint: 60,
geometricBounds: ["-0.75in","-4.45in",".5in","-.75"]
}
Kai
Copy link to clipboard
Copied
Try it with two steps:
var tempFrameProps = {
name: frameName,
contents: contentsOfFrame,
fillColor: "Yellow",
fillTint: 60,
geometricBounds: ["-0.75in","-4.45in",".5in","-.75"]
}
Kai
Copy link to clipboard
Copied
Thank you for your reply I'll try this when I get back to work
Copy link to clipboard
Copied
Thank you again.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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});
Find more inspiration, events, and resources on the new Adobe Community
Explore Now