Copy link to clipboard
Copied
Copy link to clipboard
Copied
Hi @ircoony, it might help to have a look through the code I wrote here.
For example, here is the function for applying roughen:
function LE_Roughen(item, options) {
try {
var defaults = {
amount: 5,
absoluteness: 0, /* 0 or false = relative, 1 or true = absolute */
segmentsPerInch: 10,
smoothness: 0, /* 0 = corners, 1 = smooth, 0.5 = halfway, 1.5 = too much? */
expandAppearance: false
}
var o = LE.defaultsObject(item, defaults, options, arguments.callee)
var xml = '<LiveEffect name="Adobe Roughen"><Dict data="R asiz #1 R size #2 R absoluteness #3 R dtal #4 R roundness #5 "/></LiveEffect>'
.replace(/#1/, o.amount)
.replace(/#2/, o.amount)
.replace(/#3/, Number(o.absoluteness))
.replace(/#4/, o.segmentsPerInch)
.replace(/#5/, o.smoothness);
LE.applyEffect(item, xml, o.expandAppearance);
} catch (error) {
LE.handleError(error);
}
};
Note: that this example won't work by itself (it is designed for use with the other code file), but it explicitly shows you how to populate the Dict. Let me know if you get stuck.
- Mark
Copy link to clipboard
Copied
You're the best Mark! It helped me a lot to see how to populate the Dict. My code is now working without any popups 🙂
Copy link to clipboard
Copied
HI! I'm an illustrator who doe'sn't know much about JSX sady but I m trying to figure out how to make a script that will automatically apply the roughen effect to a an object. I have to do this repeatedly at work and I would love to automate the prosess. Any help would be greatfully recieved!
Thanks.
J
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more