Clipboard Viewer

Allows us to inspect all clipboard type bundle ids, and any textually representable data that they contain, in JSON format.

For example, if we we copy an object in OmniGraffle, it gives us a JSON representation of all the object properties, which we can use in a Javascript action.

OmniGraffle arrow as clipboard data
{
  "com.omnigroup.OmniGraffle.GraphicType as propertyList": {
    "Layers": [
      {
        "Print": true,
        "Lock": false,
        "View": true,
        "Name": "Layer 1",
        "Artboards": false
      }
    ],
    "Origin": "{0, 0}",
    "Scale": "No scale",
    "Color": {
      "g": "1",
      "space": "srgb",
      "r": "1",
      "b": "1"
    },
    "GraphicsList": [
      {
        "Points": [
          "{154.48819037807269, 55.275591052704904}",
          "{210.4688597830702, 109.76605605911311}"
        ],
        "LayerIndex": 0,
        "AllowLabelDrop": false,
        "Style": {
          "shadow": {
            "Draws": "NO"
          },
          "stroke": {
            "Legacy": false,
            "HeadArrow": "FilledArrow",
            "Color": {
              "g": "0.149131",
              "space": "srgb",
              "r": "1",
              "b": "0"
            },
            "TailArrow": "0",
            "Width": 2
          },
          "fill": {
            "Draws": "NO"
          }
        },
        "FontInfo": {
          "Size": 12,
          "Font": "Helvetica"
        },
        "Class": "LineGraphic",
        "ID": 8
      }
    ],
    "ZoomLevel": 1,
    "DocumentSettings": {
      "ApplicationVersion": [
        "com.omnigroup.OmniGraffle7",
        "181.4.0.297378"
      ],
      "Modifier": "Robin Trew",
      "Creator": "Robin Trew",
      "CreationDate": "2017-11-27 17:49:13 +0000",
      "ModificationDate": "2017-11-27 17:51:20 +0000",
      "SheetTitle": "Canvas 1",
      "FileName": "Untitled",
      "GraphDocumentVersion": 14,
      "ModelIndex": 0
    }
  },
  "com.omnigroup.OmniGraffle.GraphicType as string": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>Color</key>\n\t<dict>\n\t\t<key>b</key>\n\t\t<string>1</string>\n\t\t<key>g</key>\n\t\t<string>1</string>\n\t\t<key>r</key>\n\t\t<string>1</string>\n\t\t<key>space</key>\n\t\t<string>srgb</string>\n\t</dict>\n\t<key>DocumentSettings</key>\n\t<dict>\n\t\t<key>ApplicationVersion</key>\n\t\t<array>\n\t\t\t<string>com.omnigroup.OmniGraffle7</string>\n\t\t\t<string>181.4.0.297378</string>\n\t\t</array>\n\t\t<key>CreationDate</key>\n\t\t<string>2017-11-27 17:49:13 +0000</string>\n\t\t<key>Creator</key>\n\t\t<string>Robin Trew</string>\n\t\t<key>FileName</key>\n\t\t<string>Untitled</string>\n\t\t<key>GraphDocumentVersion</key>\n\t\t<integer>14</integer>\n\t\t<key>ModelIndex</key>\n\t\t<integer>0</integer>\n\t\t<key>ModificationDate</key>\n\t\t<string>2017-11-27 17:51:20 +0000</string>\n\t\t<key>Modifier</key>\n\t\t<string>Robin Trew</string>\n\t\t<key>SheetTitle</key>\n\t\t<string>Canvas 1</string>\n\t</dict>\n\t<key>GraphicsList</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>AllowLabelDrop</key>\n\t\t\t<false/>\n\t\t\t<key>Class</key>\n\t\t\t<string>LineGraphic</string>\n\t\t\t<key>FontInfo</key>\n\t\t\t<dict>\n\t\t\t\t<key>Font</key>\n\t\t\t\t<string>Helvetica</string>\n\t\t\t\t<key>Size</key>\n\t\t\t\t<real>12</real>\n\t\t\t</dict>\n\t\t\t<key>ID</key>\n\t\t\t<integer>8</integer>\n\t\t\t<key>LayerIndex</key>\n\t\t\t<integer>0</integer>\n\t\t\t<key>Points</key>\n\t\t\t<array>\n\t\t\t\t<string>{154.48819037807269, 55.275591052704904}</string>\n\t\t\t\t<string>{210.4688597830702, 109.76605605911311}</string>\n\t\t\t</array>\n\t\t\t<key>Style</key>\n\t\t\t<dict>\n\t\t\t\t<key>fill</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Draws</key>\n\t\t\t\t\t<string>NO</string>\n\t\t\t\t</dict>\n\t\t\t\t<key>shadow</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Draws</key>\n\t\t\t\t\t<string>NO</string>\n\t\t\t\t</dict>\n\t\t\t\t<key>stroke</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Color</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>b</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>g</key>\n\t\t\t\t\t\t<string>0.149131</string>\n\t\t\t\t\t\t<key>r</key>\n\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t<key>space</key>\n\t\t\t\t\t\t<string>srgb</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>HeadArrow</key>\n\t\t\t\t\t<string>FilledArrow</string>\n\t\t\t\t\t<key>Legacy</key>\n\t\t\t\t\t<false/>\n\t\t\t\t\t<key>TailArrow</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t\t<key>Width</key>\n\t\t\t\t\t<real>2</real>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t</dict>\n\t</array>\n\t<key>Layers</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>Artboards</key>\n\t\t\t<false/>\n\t\t\t<key>Lock</key>\n\t\t\t<false/>\n\t\t\t<key>Name</key>\n\t\t\t<string>Layer 1</string>\n\t\t\t<key>Print</key>\n\t\t\t<true/>\n\t\t\t<key>View</key>\n\t\t\t<true/>\n\t\t</dict>\n\t</array>\n\t<key>Origin</key>\n\t<string>{0, 0}</string>\n\t<key>Scale</key>\n\t<string>No scale</string>\n\t<key>ZoomLevel</key>\n\t<real>1</real>\n</dict>\n</plist>\n",
  "com.omnigroup.OmniGraffle.GraphicType as data": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>Color</key>\n\t<dict>\n\t\t<key>b</key>\n\t\t<string>1</string>\n\t\t<key>g</key>\n\t\t<string>1</string>\n\t\t<key>r</key>\n\t\t<string>1</string>\n\t\t<key>space</key>\n\t\t<string>srgb</string>\n\t</dict>\n\t<key>DocumentSettings</key>\n\t<dict>\n\t\t<key>ApplicationVersion</key>\n\t\t<array>\n\t\t\t<string>com.omnigroup.OmniGraffle7</string>\n\t\t\t<string>181.4.0.297378</string>\n\t\t</array>\n\t\t<key>CreationDate</key>\n\t\t<string>2017-11-27 17:49:13 +0000</string>\n\t\t<key>Creator</key>\n\t\t<string>Robin Trew</string>\n\t\t<key>FileName</key>\n\t\t<string>Untitled</string>\n\t\t<key>GraphDocumentVersion</key>\n\t\t<integer>14</integer>\n\t\t<key>ModelIndex</key>\n\t\t<integer>0</integer>\n\t\t<key>ModificationDate</key>\n\t\t<string>2017-11-27 17:51:20 +0000</string>\n\t\t<key>Modifier</key>\n\t\t<string>Robin Trew</string>\n\t\t<key>SheetTitle</key>\n\t\t<string>Canvas 1</string>\n\t</dict>\n\t<key>GraphicsList</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>AllowLabelDrop</key>\n\t\t\t<false/>\n\t\t\t<key>Class</key>\n\t\t\t<string>LineGraphic</string>\n\t\t\t<key>FontInfo</key>\n\t\t\t<dict>\n\t\t\t\t<key>Font</key>\n\t\t\t\t<string>Helvetica</string>\n\t\t\t\t<key>Size</key>\n\t\t\t\t<real>12</real>\n\t\t\t</dict>\n\t\t\t<key>ID</key>\n\t\t\t<integer>8</integer>\n\t\t\t<key>LayerIndex</key>\n\t\t\t<integer>0</integer>\n\t\t\t<key>Points</key>\n\t\t\t<array>\n\t\t\t\t<string>{154.48819037807269, 55.275591052704904}</string>\n\t\t\t\t<string>{210.4688597830702, 109.76605605911311}</string>\n\t\t\t</array>\n\t\t\t<key>Style</key>\n\t\t\t<dict>\n\t\t\t\t<key>fill</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Draws</key>\n\t\t\t\t\t<string>NO</string>\n\t\t\t\t</dict>\n\t\t\t\t<key>shadow</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Draws</key>\n\t\t\t\t\t<string>NO</string>\n\t\t\t\t</dict>\n\t\t\t\t<key>stroke</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Color</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>b</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>g</key>\n\t\t\t\t\t\t<string>0.149131</string>\n\t\t\t\t\t\t<key>r</key>\n\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t<key>space</key>\n\t\t\t\t\t\t<string>srgb</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>HeadArrow</key>\n\t\t\t\t\t<string>FilledArrow</string>\n\t\t\t\t\t<key>Legacy</key>\n\t\t\t\t\t<false/>\n\t\t\t\t\t<key>TailArrow</key>\n\t\t\t\t\t<string>0</string>\n\t\t\t\t\t<key>Width</key>\n\t\t\t\t\t<real>2</real>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t</dict>\n\t</array>\n\t<key>Layers</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>Artboards</key>\n\t\t\t<false/>\n\t\t\t<key>Lock</key>\n\t\t\t<false/>\n\t\t\t<key>Name</key>\n\t\t\t<string>Layer 1</string>\n\t\t\t<key>Print</key>\n\t\t\t<true/>\n\t\t\t<key>View</key>\n\t\t\t<true/>\n\t\t</dict>\n\t</array>\n\t<key>Origin</key>\n\t<string>{0, 0}</string>\n\t<key>Scale</key>\n\t<string>No scale</string>\n\t<key>ZoomLevel</key>\n\t<real>1</real>\n</dict>\n</plist>\n",
  "dyn.ah62d4rv4gu8y24psrrbgc25pkvu1k2k as propertyList": {
    "serverAppName": "OmniGraffle",
    "appData": {
      "Layers": [
        {
          "Print": true,
          "Lock": false,
          "View": true,
          "Name": "Layer 1",
          "Artboards": false
        }
      ],
      "Origin": "{0, 0}",
      "Scale": "No scale",
      "Color": {
        "g": "1",
        "space": "srgb",
        "r": "1",
        "b": "1"
      },
      "GraphicsList": [
        {
          "Points": [
            "{154.48819037807269, 55.275591052704904}",
            "{210.4688597830702, 109.76605605911311}"
          ],
          "LayerIndex": 0,
          "AllowLabelDrop": false,
          "Style": {
            "shadow": {
              "Draws": "NO"
            },
            "stroke": {
              "Legacy": false,
              "HeadArrow": "FilledArrow",
              "Color": {
                "g": "0.149131",
                "space": "srgb",
                "r": "1",
                "b": "0"
              },
              "TailArrow": "0",
              "Width": 2
            },
            "fill": {
              "Draws": "NO"
            }
          },
          "FontInfo": {
            "Size": 12,
            "Font": "Helvetica"
          },
          "Class": "LineGraphic",
          "ID": 8
        }
      ],
      "ZoomLevel": 1,
      "DocumentSettings": {
        "ApplicationVersion": [
          "com.omnigroup.OmniGraffle7",
          "181.4.0.297378"
        ],
        "Modifier": "Robin Trew",
        "Creator": "Robin Trew",
        "CreationDate": "2017-11-27 17:49:13 +0000",
        "ModificationDate": "2017-11-27 17:51:20 +0000",
        "SheetTitle": "Canvas 1",
        "FileName": "Untitled",
        "GraphDocumentVersion": 14,
        "ModelIndex": 0
      }
    },
    "serverName": "OmniGraffle",
    "bundleId": "com.omnigroup.OmniGraffle7",
    "version": "A",
    "ApplicationURL": "http://www.omnigroup.com/applications/OmniGraffle",
    "refresh": 0
  },
  "dyn.ah62d4rv4gu8y24psrrbgc25pkvu1k2k as string": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>ApplicationURL</key>\n\t<string>http://www.omnigroup.com/applications/OmniGraffle</string>\n\t<key>appData</key>\n\t<dict>\n\t\t<key>Color</key>\n\t\t<dict>\n\t\t\t<key>b</key>\n\t\t\t<string>1</string>\n\t\t\t<key>g</key>\n\t\t\t<string>1</string>\n\t\t\t<key>r</key>\n\t\t\t<string>1</string>\n\t\t\t<key>space</key>\n\t\t\t<string>srgb</string>\n\t\t</dict>\n\t\t<key>DocumentSettings</key>\n\t\t<dict>\n\t\t\t<key>ApplicationVersion</key>\n\t\t\t<array>\n\t\t\t\t<string>com.omnigroup.OmniGraffle7</string>\n\t\t\t\t<string>181.4.0.297378</string>\n\t\t\t</array>\n\t\t\t<key>CreationDate</key>\n\t\t\t<string>2017-11-27 17:49:13 +0000</string>\n\t\t\t<key>Creator</key>\n\t\t\t<string>Robin Trew</string>\n\t\t\t<key>FileName</key>\n\t\t\t<string>Untitled</string>\n\t\t\t<key>GraphDocumentVersion</key>\n\t\t\t<integer>14</integer>\n\t\t\t<key>ModelIndex</key>\n\t\t\t<integer>0</integer>\n\t\t\t<key>ModificationDate</key>\n\t\t\t<string>2017-11-27 17:51:20 +0000</string>\n\t\t\t<key>Modifier</key>\n\t\t\t<string>Robin Trew</string>\n\t\t\t<key>SheetTitle</key>\n\t\t\t<string>Canvas 1</string>\n\t\t</dict>\n\t\t<key>GraphicsList</key>\n\t\t<array>\n\t\t\t<dict>\n\t\t\t\t<key>AllowLabelDrop</key>\n\t\t\t\t<false/>\n\t\t\t\t<key>Class</key>\n\t\t\t\t<string>LineGraphic</string>\n\t\t\t\t<key>FontInfo</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Font</key>\n\t\t\t\t\t<string>Helvetica</string>\n\t\t\t\t\t<key>Size</key>\n\t\t\t\t\t<real>12</real>\n\t\t\t\t</dict>\n\t\t\t\t<key>ID</key>\n\t\t\t\t<integer>8</integer>\n\t\t\t\t<key>LayerIndex</key>\n\t\t\t\t<integer>0</integer>\n\t\t\t\t<key>Points</key>\n\t\t\t\t<array>\n\t\t\t\t\t<string>{154.48819037807269, 55.275591052704904}</string>\n\t\t\t\t\t<string>{210.4688597830702, 109.76605605911311}</string>\n\t\t\t\t</array>\n\t\t\t\t<key>Style</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>fill</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>Draws</key>\n\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>shadow</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>Draws</key>\n\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>stroke</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>Color</key>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>b</key>\n\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t<key>g</key>\n\t\t\t\t\t\t\t<string>0.149131</string>\n\t\t\t\t\t\t\t<key>r</key>\n\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t<key>space</key>\n\t\t\t\t\t\t\t<string>srgb</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<key>HeadArrow</key>\n\t\t\t\t\t\t<string>FilledArrow</string>\n\t\t\t\t\t\t<key>Legacy</key>\n\t\t\t\t\t\t<false/>\n\t\t\t\t\t\t<key>TailArrow</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>Width</key>\n\t\t\t\t\t\t<real>2</real>\n\t\t\t\t\t</dict>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t</array>\n\t\t<key>Layers</key>\n\t\t<array>\n\t\t\t<dict>\n\t\t\t\t<key>Artboards</key>\n\t\t\t\t<false/>\n\t\t\t\t<key>Lock</key>\n\t\t\t\t<false/>\n\t\t\t\t<key>Name</key>\n\t\t\t\t<string>Layer 1</string>\n\t\t\t\t<key>Print</key>\n\t\t\t\t<true/>\n\t\t\t\t<key>View</key>\n\t\t\t\t<true/>\n\t\t\t</dict>\n\t\t</array>\n\t\t<key>Origin</key>\n\t\t<string>{0, 0}</string>\n\t\t<key>Scale</key>\n\t\t<string>No scale</string>\n\t\t<key>ZoomLevel</key>\n\t\t<real>1</real>\n\t</dict>\n\t<key>bundleId</key>\n\t<string>com.omnigroup.OmniGraffle7</string>\n\t<key>refresh</key>\n\t<real>0.0</real>\n\t<key>serverAppName</key>\n\t<string>OmniGraffle</string>\n\t<key>serverName</key>\n\t<string>OmniGraffle</string>\n\t<key>version</key>\n\t<string>A</string>\n</dict>\n</plist>\n",
  "dyn.ah62d4rv4gu8y24psrrbgc25pkvu1k2k as data": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>ApplicationURL</key>\n\t<string>http://www.omnigroup.com/applications/OmniGraffle</string>\n\t<key>appData</key>\n\t<dict>\n\t\t<key>Color</key>\n\t\t<dict>\n\t\t\t<key>b</key>\n\t\t\t<string>1</string>\n\t\t\t<key>g</key>\n\t\t\t<string>1</string>\n\t\t\t<key>r</key>\n\t\t\t<string>1</string>\n\t\t\t<key>space</key>\n\t\t\t<string>srgb</string>\n\t\t</dict>\n\t\t<key>DocumentSettings</key>\n\t\t<dict>\n\t\t\t<key>ApplicationVersion</key>\n\t\t\t<array>\n\t\t\t\t<string>com.omnigroup.OmniGraffle7</string>\n\t\t\t\t<string>181.4.0.297378</string>\n\t\t\t</array>\n\t\t\t<key>CreationDate</key>\n\t\t\t<string>2017-11-27 17:49:13 +0000</string>\n\t\t\t<key>Creator</key>\n\t\t\t<string>Robin Trew</string>\n\t\t\t<key>FileName</key>\n\t\t\t<string>Untitled</string>\n\t\t\t<key>GraphDocumentVersion</key>\n\t\t\t<integer>14</integer>\n\t\t\t<key>ModelIndex</key>\n\t\t\t<integer>0</integer>\n\t\t\t<key>ModificationDate</key>\n\t\t\t<string>2017-11-27 17:51:20 +0000</string>\n\t\t\t<key>Modifier</key>\n\t\t\t<string>Robin Trew</string>\n\t\t\t<key>SheetTitle</key>\n\t\t\t<string>Canvas 1</string>\n\t\t</dict>\n\t\t<key>GraphicsList</key>\n\t\t<array>\n\t\t\t<dict>\n\t\t\t\t<key>AllowLabelDrop</key>\n\t\t\t\t<false/>\n\t\t\t\t<key>Class</key>\n\t\t\t\t<string>LineGraphic</string>\n\t\t\t\t<key>FontInfo</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>Font</key>\n\t\t\t\t\t<string>Helvetica</string>\n\t\t\t\t\t<key>Size</key>\n\t\t\t\t\t<real>12</real>\n\t\t\t\t</dict>\n\t\t\t\t<key>ID</key>\n\t\t\t\t<integer>8</integer>\n\t\t\t\t<key>LayerIndex</key>\n\t\t\t\t<integer>0</integer>\n\t\t\t\t<key>Points</key>\n\t\t\t\t<array>\n\t\t\t\t\t<string>{154.48819037807269, 55.275591052704904}</string>\n\t\t\t\t\t<string>{210.4688597830702, 109.76605605911311}</string>\n\t\t\t\t</array>\n\t\t\t\t<key>Style</key>\n\t\t\t\t<dict>\n\t\t\t\t\t<key>fill</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>Draws</key>\n\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>shadow</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>Draws</key>\n\t\t\t\t\t\t<string>NO</string>\n\t\t\t\t\t</dict>\n\t\t\t\t\t<key>stroke</key>\n\t\t\t\t\t<dict>\n\t\t\t\t\t\t<key>Color</key>\n\t\t\t\t\t\t<dict>\n\t\t\t\t\t\t\t<key>b</key>\n\t\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t\t<key>g</key>\n\t\t\t\t\t\t\t<string>0.149131</string>\n\t\t\t\t\t\t\t<key>r</key>\n\t\t\t\t\t\t\t<string>1</string>\n\t\t\t\t\t\t\t<key>space</key>\n\t\t\t\t\t\t\t<string>srgb</string>\n\t\t\t\t\t\t</dict>\n\t\t\t\t\t\t<key>HeadArrow</key>\n\t\t\t\t\t\t<string>FilledArrow</string>\n\t\t\t\t\t\t<key>Legacy</key>\n\t\t\t\t\t\t<false/>\n\t\t\t\t\t\t<key>TailArrow</key>\n\t\t\t\t\t\t<string>0</string>\n\t\t\t\t\t\t<key>Width</key>\n\t\t\t\t\t\t<real>2</real>\n\t\t\t\t\t</dict>\n\t\t\t\t</dict>\n\t\t\t</dict>\n\t\t</array>\n\t\t<key>Layers</key>\n\t\t<array>\n\t\t\t<dict>\n\t\t\t\t<key>Artboards</key>\n\t\t\t\t<false/>\n\t\t\t\t<key>Lock</key>\n\t\t\t\t<false/>\n\t\t\t\t<key>Name</key>\n\t\t\t\t<string>Layer 1</string>\n\t\t\t\t<key>Print</key>\n\t\t\t\t<true/>\n\t\t\t\t<key>View</key>\n\t\t\t\t<true/>\n\t\t\t</dict>\n\t\t</array>\n\t\t<key>Origin</key>\n\t\t<string>{0, 0}</string>\n\t\t<key>Scale</key>\n\t\t<string>No scale</string>\n\t\t<key>ZoomLevel</key>\n\t\t<real>1</real>\n\t</dict>\n\t<key>bundleId</key>\n\t<string>com.omnigroup.OmniGraffle7</string>\n\t<key>refresh</key>\n\t<real>0.0</real>\n\t<key>serverAppName</key>\n\t<string>OmniGraffle</string>\n\t<key>serverName</key>\n\t<string>OmniGraffle</string>\n\t<key>version</key>\n\t<string>A</string>\n</dict>\n</plist>\n"
}

Or, if we copy a Note Link in Quiver we can see which Clipboard type keys hold the name of the Quiver note, and which contain a URL:

Clipboard contents after Quiver > Copy Note Link
{
  "com.happenapps.quiver.note-link as propertyList": {
    "$version": 100000,
    "$objects": [
      "$null",
      {
        "NS.objects": [
          {}
        ],
        "$class": {}
      },
      "31C6A0C5-DAF3-4085-841A-E7F646EC59A3",
      {
        "$classname": "NSArray",
        "$classes": [
          "NSArray",
          "NSObject"
        ]
      }
    ],
    "$archiver": "NSKeyedArchiver",
    "$top": {
      "root": {}
    }
  },
  "public.rtf as string": "{\\rtf1\\ansi\\ansicpg1252\\cocoartf1504\\cocoasubrtf830\n{\\fonttbl\\f0\\froman\\fcharset0 Times-Roman;}\n{\\colortbl;\\red255\\green255\\blue255;\\red0\\green0\\blue233;}\n{\\*\\expandedcolortbl;;\\cssrgb\\c0\\c0\\c93333;}\n\\deftab720\n\\pard\\pardeftab720\\sl280\\partightenfactor0\n{\\field{\\*\\fldinst{HYPERLINK \"quiver:///notes/31C6A0C5-DAF3-4085-841A-E7F646EC59A3\"}}{\\fldrslt \n\\f0\\fs24 \\cf2 \\expnd0\\expndtw0\\kerning0\n\\ul \\ulc2 \\outl0\\strokewidth0 \\strokec2 mapAccumL}}}",
  "public.rtf as data": "{\\rtf1\\ansi\\ansicpg1252\\cocoartf1504\\cocoasubrtf830\n{\\fonttbl\\f0\\froman\\fcharset0 Times-Roman;}\n{\\colortbl;\\red255\\green255\\blue255;\\red0\\green0\\blue233;}\n{\\*\\expandedcolortbl;;\\cssrgb\\c0\\c0\\c93333;}\n\\deftab720\n\\pard\\pardeftab720\\sl280\\partightenfactor0\n{\\field{\\*\\fldinst{HYPERLINK \"quiver:///notes/31C6A0C5-DAF3-4085-841A-E7F646EC59A3\"}}{\\fldrslt \n\\f0\\fs24 \\cf2 \\expnd0\\expndtw0\\kerning0\n\\ul \\ulc2 \\outl0\\strokewidth0 \\strokec2 mapAccumL}}}",
  "public.utf16-external-plain-text as propertyList": "mapAccumL",
  "public.utf8-plain-text as propertyList": "quiver:///notes/31C6A0C5-DAF3-4085-841A-E7F646EC59A3",
  "public.utf8-plain-text as string": "quiver:///notes/31C6A0C5-DAF3-4085-841A-E7F646EC59A3",
  "public.utf8-plain-text as data": "quiver:///notes/31C6A0C5-DAF3-4085-841A-E7F646EC59A3",
  "com.apple.traditional-mac-plain-text as propertyList": "mapAccumL",
  "com.apple.traditional-mac-plain-text as string": "mapAccumL",
  "com.apple.traditional-mac-plain-text as data": "mapAccumL",
  "public.html as string": "<a href=\"quiver:///notes/31C6A0C5-DAF3-4085-841A-E7F646EC59A3\">mapAccumL</a>",
  "public.html as data": "<a href=\"quiver:///notes/31C6A0C5-DAF3-4085-841A-E7F646EC59A3\">mapAccumL</a>"
}

Clipboard View (all textually representable data as JSON).kmmacros (22.6 KB)


JavaScript for Automation source code:

(() => {
    'use strict';;

    ObjC.import('AppKit');

    // CLIPBOARD -------------------------------------------------------------

    // showClipBoard :: () -> JSON String
    const showClipboard = () => {

        // GENERIC FUNCTIONS -------------------------------------------------

        // cartesianProduct :: [a] -> [b] -> [(a, b)]
        const cartesianProduct = (xs, ys) =>
            concatMap((x => concatMap(y => [
                [x, y]
            ], ys)), xs);

        // concatMap :: (a -> [b]) -> [a] -> [b]
        const concatMap = (f, xs) =>
            xs.length > 0 ? [].concat.apply([], xs.map(f)) : [];

        // foldl :: (a -> b -> a) -> a -> [b] -> a
        const foldl = (f, a, xs) => xs.reduce(f, a);

        // VIEW OF CLIPBOARD TYPES -------------------------------------------
        const
            pBoard = $.NSPasteboard.generalPasteboard,
            clipTypes = ObjC.deepUnwrap(
                pBoard.pasteboardItems.js[0].types
            ),
            types = ['propertyList', 'string', 'data']
        //types = ['propertyList', 'string'];

        return JSON.stringify(
            foldl(
                (a, [bundleID, k]) => (
                    a[bundleID + ' as ' + k] = ObjC.deepUnwrap(
                        k !== 'data' ? (
                            pBoard[k + 'ForType'](bundleID)
                        ) : $.NSString.alloc.initWithDataEncoding(
                            pBoard.dataForType(bundleID),
                            $.NSUTF8StringEncoding
                        )
                    ),
                    a
                ), {},
                cartesianProduct(clipTypes, types)
            ), null, 2
        );
    };

    return showClipboard();
})();

3 Likes

Analogous code in AppleScript, returning an AppleScript record, rather than JSON:

use framework "Foundation"
use framework "Appkit"
use scripting additions


-- INSPECTING DIFFERENT TYPES OF DATA ON THE CLIPBOARD

-- showClipBoard :: () -> Record
on showClipboard()
    set ca to current application
    set pBoard to ca's NSPasteboard's generalPasteboard
    set clipTypes to (item 1 of (pBoard's pasteboardItems as list))'s types as list
    set types to {"propertyList", "string", "data"}
    
    script dataFor
        on |λ|(a, bundleType)
            set {bundleID, k} to bundleType
            if k = "string" then
                set v to pBoard's stringForType:bundleID
            else if k = "propertyList" then
                set v to pBoard's propertyListForType:bundleID
            else -- "data"
                set v to ca's NSString's alloc()'s ¬
                    initWithData:(pBoard's dataForType:bundleID) ¬
                        encoding:(ca's NSUTF8StringEncoding)
            end if
            if v is missing value then
                a
            else
                mapInsert(a, bundleID & " as " & k, v)
            end if
        end |λ|
    end script
    foldl(dataFor, {name:""}, cartesianProduct(clipTypes, types))
end showClipboard


-- TEST ------------------------------------------------------------------
on run
    
    showClipboard()
    
end run


-- GENERIC FUNCTIONS -----------------------------------------------------

-- cartesianProduct :: [a] -> [b] -> [(a, b)]
on cartesianProduct(xs, ys)
    script
        on |λ|(x)
            script
                on |λ|(y)
                    {{x, y}}
                end |λ|
            end script
            concatMap(result, ys)
        end |λ|
    end script
    concatMap(result, xs)
end cartesianProduct

-- concatMap :: (a -> [b]) -> [a] -> [b]
on concatMap(f, xs)
    set acc to {}
    tell mReturn(f)
        repeat with x in xs
            set acc to acc & |λ|(contents of x)
        end repeat
    end tell
    return acc
end concatMap

-- foldl :: (a -> b -> a) -> a -> [b] -> a
on foldl(f, startValue, xs)
    tell mReturn(f)
        set v to startValue
        set lng to length of xs
        repeat with i from 1 to lng
            set v to |λ|(v, item i of xs, i, xs)
        end repeat
        return v
    end tell
end foldl

-- mapInsert :: Dict -> k -> v -> Dict
on mapInsert(rec, k, v)
    set ca to current application
    set nsDct to (ca's NSMutableDictionary's dictionaryWithDictionary:rec)
    nsDct's setValue:v forKey:(k as string)
    item 1 of ((ca's NSArray's arrayWithObject:nsDct) as list)
end mapInsert

-- Lift 2nd class handler function into 1st class script wrapper
-- mReturn :: First-class m => (a -> b) -> m (a -> b)
on mReturn(f)
    if class of f is script then
        f
    else
        script
            property |λ| : f
        end script
    end if
end mReturn
4 Likes

@ComplexPoint, very nice tool. :+1:

1 Like