macOS: To save action file, enter file name (no spaces) and click Save button. iOS: tap here.
/*{
"type": "action",
"targets": ["omnigraffle"],
"author": "Your Name or Company",
"description": "Description of this action.",
"label": "The menu item text",
"paletteLabel": "Palette Text"
}*/
var _ = function(){
var action = new PlugIn.Action(function(selection, sender) {
// action code
// selection options: canvas, document, graphics, lines, solids, view
selection.graphics.forEach(function(item){
item.fillColor = Color.red
})
});
action.validate = function(selection, sender) {
// validation code
// selection options: canvas, document, graphics, lines, solids, view
if(selection.graphics.length > 0){return true} else {return false}
};
return action;
}();
_;