In OmniGraffle 7.8 we have made the ID attribute on Graphics far less prone to be changed when the graphic itself is manipulated, plus the ID should be consistent now when opening and closing documents. If you use the ID attribute in your scripts we would really like some feedback on how things are working in the Public Test version of OmniGraffle 7.8.
The latest 7.8 build also has scripting related crash fixes!
Here’s a handy Omni Automation plugin for viewing the ID of the selected graphic. Copy to a text editor and save as a file with the “omnijs” file extension. Put in PlugIns folder (Automation menu)
// COPY & PASTE into text editor app. EDIT & SAVE with “.omnijs” file extension.
/*{
"type": "action",
"targets": ["omnigraffle"],
"author": "Otto Automator",
"description": "Shows the ID of the selected graphic.",
"label": "ID of Selected Graphic",
"paletteLabel": "Graphic ID"
}*/
var _ = function(){
var action = new PlugIn.Action(function(selection, sender){
// action code
// selection options: canvas, document, graphics, lines, solids, view
graphic = selection.graphics[0]
new Alert('Graphic ID',graphic.id.toString()).show(function(result){})
});
action.validate = function(selection, sender){
// validation code
// selection options: canvas, document, graphics, lines, solids, view
if(selection.graphics.length === 1){return true} else {return false}
};
return action;
}();
_;