fetchStorableClipboard error -1728

The fetchStorableClipboard handler from your book errors on 11.6 with -1728

This is the line
– get the types of data stored on the pasteboard item
set theTypes to (item i of theItems)'s type {}

Can’t get type {} of item 1 of «class ocid» id «data optr000000000003ED0700600000».
type {} of item 1 of (NSArray) {<NSPasteboardItem: 0x600003d267c0>}

Do you have a fix?

I’m not sure whose book you’re referring to, but that line looks wrong. Try:

set theTypes to (item i of theItems)'s |types|()

So “types” is a property of nspasteboard. NOTE: must have pipes in SD “|types|” or it compiles as type.
I think this happened when converting to .applescript text files so it could be used as a snippet in SD, probably with a script and osadecompile, then it changed to type by SD when compiled.

From the book: Everyday AppleScriptObjC .