// Fireworks JavaScript Command // Install by copying to Fireworks/Configuration/Commands/ // Run in Fireworks via the Commands menu // Aaron Beall - http://abeall.com var dom = fw.selection ? fw.getDocumentDOM() : false; // document object var sel = new Array().concat(fw.selection); function RoughenPaths() { // require active document if (!sel.length) return false; var paths = []; for(var s in sel){ if(sel[s].contours) paths.push(sel[s]); } if(!paths.length) return false; var amount = prompt('Amount:',(fw.RoughenPaths_amount||5)); if(amount==null || isNaN(amount)) return; amount = Number(amount); fw.RoughenPaths_amount = amount; for(var p in paths){ for(var c in paths[p].contours){ for(var n in paths[p].contours[c].nodes){ var node = paths[p].contours[c].nodes[n]; var x = Math.random()*amount-Math.random()*amount; var y = Math.random()*amount-Math.random()*amount; node.x += x; node.predX += x; node.succX += x; node.y += y; node.predY += y; node.succY += y; } } } return true; } RoughenPaths();