Place Image in OmniGraffle

Here is a useful Shortcut workflow for the Share menu that imports the selected image or image file into the current OmniGraffle document.

Available by tapping the Shortcuts Share menu item  1  in the Photos app or the Files app when an image or image file is selected, and then the “Place Image in OmniGraffle” shortcut  2  in the list of available shortcuts. (see below)


The workflow will scale the image copy to the percentage value you choose, and then place the scaled version in either the currently selected graphic solid or a newly created gra[hic that is sized-to-fit the scaled image.

The Place Image Script

The Omni Automation script performs the following two functions:

A percent-encoded version of the script containing a text placeholder for the image data is inserted into the shortcut workflow as the contents of Text action.

try { imageData = Data.fromBase64('XXXXX') sel =[0].selection cnvs = sel.canvas if (sel.solids.length === 1){ sel.solids[0].image = addImage(imageData) } else { solid = cnvs.newShape() solid.strokeThickness = 0 solid.shadowColor = null solid.fillColor = null solid.image = addImage(imageData) newGeometry = solid.geometry newGeometry.size = solid.image.originalSize solid.geometry = newGeometry } } catch (err){ new Alert(,err.message).show(function(result){}) }

 02  During the execution of the shortcut, the text placeholder “XXXXX” is replaced with the image data in base64 encoded format. This statement uses the fromBase64() of the Data class to convert the encoded data into image data stored in the variable imageData.

 05-16  If a single solid shape is currently selected, the image is placed in the selected shape  06  , otherwise a new shape containing the image is created and sized to fit the image  08-15 

The Shortcut Workflow

The following image capture shows the Shortcut workflow that is triggered fro the Share sheet.

You can DOWNLOAD the shortcut workflow file.


This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.