Tag and Import

Adding the images from this website to your OmniGraffle document is a very easy process. You simply “Tag” and then “Import!” It really is that effortless. Just follow the instructions below.

var slds = document.windows[0].selection.solids if (slds.length == 1){ slds[0].setUserData('AAAAA','BBBBB') slds[0].notes = 'DDDDD' slds[0].setUserData('EEEEE','FFFFF') slds[0].name = 'BBBBB' } else { alert = new Alert('SELECTION ERROR','Please select a single graphic.') alert.show(function(result){}) }
var cnvs = document.windows[0].selection.canvas var dataKey = 'SKU' var urlKey = 'URL' var keyValues = new Array() var urlValues = new Array() for(i = 0; i < cnvs.graphics.length; i++){ aGraph = cnvs.graphics[i] aValue = aGraph.userData[dataKey] if(aValue != null){ keyValues.push(aValue) u = aGraph.userData[urlKey] if(u != null){ urlValues.push(u) } else { urlValues.push('') } } } var valCount = keyValues.length for (i = 0; i < valCount; i++) { var keyValue = keyValues[i] aStr = urlValues[i] fileURL = URL.fromString(aStr) fileURL.fetch((function(keyValue, data) { aGraph = cnvs.graphicWithUserDataForKey(keyValue, dataKey) aGraph.image = addImage(data) }).bind(this, keyValue)) }
var cnvs = document.windows[0].selection.canvas var dataKey = 'SKU' var fileExtension = 'jpg' var keyValues = new Array() for(i = 0; i < cnvs.graphics.length; i++){ aGraph = cnvs.graphics[i] aValue = aGraph.userData[dataKey] if(aValue != null){keyValues.push(aValue)} } var valCount = keyValues.length if(valCount == 0){ new Alert('MISSING DATA KEYS','No graphics are assigned the data key:\n\n\t' + dataKey).show(function(result){throw new Error('script cancelled')}) } else { fldrURL = URL.fromString('https://omni-automation.com/omnigraffle/tagged-import/gfx/') if (fldrURL == null){throw new Error('user cancelled')} fldrURLstr = fldrURL.string for (i = 0; i < valCount; i++) { var keyValue = keyValues[i] aStr = fldrURLstr + keyValue + '.' + fileExtension console.log(aStr) fileURL = URL.fromString(aStr) fileURL.fetch((function(keyValue, data) { aGraph = cnvs.graphicWithUserDataForKey(keyValue, dataKey) aGraph.image = addImage(data) }).bind(this, keyValue)) } }
// default settings var defaultOffset = 12 var defaultTextSize = 14 // prompt for placement location var alert = new Alert("Notes Placement", "Should the notes be placed to the left, right, or below the selected graphic?") alert.addOption("Right") alert.addOption("Left") alert.addOption("Below") alert.show(function(result){ var cnvs = document.windows[0].selection.canvas var slds = document.windows[0].selection.solids if (result == 0){ slds.forEach(function(sld){ sName = sld.name sNotes = sld.notes cRect = sld.geometry nRect = new Rect(cRect.maxX + defaultOffset, cRect.minY, cRect.width, cRect.height) aShape = cnvs.addShape('Rectangle',nRect) aShape.text = sNotes aShape.name = sName aShape.shadowColor = null aShape.strokeType = null aShape.fillType = null aShape.autosizing = TextAutosizing.Overflow aShape.textHorizontalAlignment = HorizontalTextAlignment.Left aShape.textHorizontalPadding = 0 aShape.textVerticalPlacement = VerticalTextPlacement.Top aShape.textVerticalPadding = 0 aShape.textSize = defaultTextSize }) } else if (result == 1){ slds.forEach(function(sld){ sName = sld.name sNotes = sld.notes cRect = sld.geometry nRect = new Rect(cRect.minX - defaultOffset - cRect.width, cRect.minY, cRect.width, cRect.height) aShape = cnvs.addShape('Rectangle',nRect) aShape.text = sNotes aShape.name = sName aShape.shadowColor = null aShape.strokeType = null aShape.fillType = null aShape.autosizing = TextAutosizing.Overflow aShape.textHorizontalAlignment = HorizontalTextAlignment.Left aShape.textHorizontalPadding = 0 aShape.textVerticalPlacement = VerticalTextPlacement.Top aShape.textVerticalPadding = 0 aShape.textSize = defaultTextSize }) } else { slds.forEach(function(sld){ sName = sld.name sNotes = sld.notes cRect = sld.geometry nRect = new Rect(cRect.minX, cRect.maxY + defaultOffset, cRect.width, cRect.height) aShape = cnvs.addShape('Rectangle',nRect) aShape.text = sNotes aShape.name = sName aShape.shadowColor = null aShape.strokeType = null aShape.fillType = null aShape.autosizing = TextAutosizing.Overflow aShape.textHorizontalAlignment = HorizontalTextAlignment.Left aShape.textHorizontalPadding = 0 aShape.textVerticalPlacement = VerticalTextPlacement.Top aShape.textVerticalPadding = 0 aShape.textSize = defaultTextSize }) } })

INSTRUCTIONS:

 
129775 323037 323698 327764
129775323037323698327764
328393 330039 330334 330361
328393330039330334330361
330441 330452 330575 330803
330441330452330575330803
331133 331183 331731 331996
331133331183331731331996
332822 333163    
332822333163