Copy a .plist file from the Finder as a pasteable JavaScript object (JSON string)

If we select a .plist file in the Finder

this macro will copy it to the clipboard as JSON, which can be pasted into Script Editor,, CodeRunner etc as the value of a JavaScript object.

Copy selected plist file as JSON.kmmacros (21.3 KB)

JavaScript for Automation Source:

(function () {
    'use strict';

    var strPath = Application('Keyboard Maestro Engine')

    return (strPath.toLowerCase()
        .endsWith('.plist')) ? (

                null, 2
    ) : '';