Can we convert the types of the pasteboardItems to an AppleScript list of strings ?
i.e. the kind of thing that in JavaScript for Automation we might write as:
(() => {
ObjC.import('AppKit');
// LISTING
// pBoardTypes :: Clipboard () -> [String]
const pBoardTypes = () =>
ObjC.deepUnwrap(
$.NSPasteboard.generalPasteboard
.pasteboardItems.js[0].types
);
// OR TESTING
// pBoardContainsRTF :: Clipboard () -> Bool
const pBoardContainsRTF = () =>
ObjC.deepUnwrap(
$.NSPasteboard.generalPasteboard
.pasteboardItems.js[0].types
)
.includes('public.rtf');
return pBoardTypes()
.join('\n');
})();