Read values from a app pasteboard

Is there a way to read the values ​from an app pasteboard?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
    <string>MoneyMoney 2.3.3</string>
            <string>Telekom Deutschland GmbH Landgrabenweg 151</string>
            <string>Mobilfunk Kundenkonto</string>

In my case I need the key:name an his string value.

There are various ways to read the top level array or dictionary from a plist-format string.

I tend to use, through JavaScript for Automation, either:

(Some plists are dictionaries at their top level, and some array arrays, if the first method returns nothing, then we can try the second).

Your example is a dict at the the top level, so the simplest example of reading it might look something like the sample macro and JXA snippet below. (Both methods require that the plist is first written out to disk as a temporary text file).

Example - Read value from plist.kmmacros (20.1 KB)

To slightly generalize the key that you are reading, you could also write things like:

(() => {

        kme = Application('Keyboard Maestro Engine'),
        [strPlistPath, strKey] = ['plistPath', 'plistKey']
        .map(k => kme.getvariable(k));

    return ObjC.deepUnwrap(

Thanks. My main problem is: How can I write the app.pasteboard to a file … or a variable?

Got it. What’s the utility which is displaying the app clipboard strings in your screen-shot ?

I use this tool for some clipboard inspections.

OK - MoneyMoney and clipboard viewer both seem out of reach from UK appstore, but approaching from another direction, if you copy something from MoneyMoney, and run this with the JS tab selected in Script Editor, does the list include the clip type that you are looking for ?

(function() {


  return ObjC.deepUnwrap(


And if you copy again from MoneyMoney and run this ?

(function() {


  const strClipType = 'com.moneymoney-app.pasteboard';

  return ObjC.deepUnwrap(
1 Like

It works! 1000 THANKS TO YOU! :+1:

1 Like

Good !

If you prefer Applescript you could try something like

use framework "Foundation"
use scripting additions

-- unwrap :: NSObject -> a
on unwrap(objCValue)
    if objCValue is missing value then
        return missing value
        set ca to current application
        item 1 of ((ca's NSArray's arrayWithObject:objCValue) as list)
    end if
end unwrap

set strClipType to "com.moneymoney-app.pasteboard"

set ca to current application
set maybeRec to unwrap(((ca's NSPasteboard's generalPasteboard())'s ¬