I downloaded the Myriad Tables Lib v1.0.8 AppleScript script library from here.
Run the following code, and you will notice that the code will run without error:
-- use script "Myriad Tables Lib" version "1.0.8"
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
use framework "AppKit"
on fetchStorableClipboard()
set aMutableArray to current application's NSMutableArray's array() -- used to store contents
-- get the pasteboard and then its pasteboard items
set thePasteboard to current application's NSPasteboard's generalPasteboard()
-- loop through pasteboard items
repeat with anItem in thePasteboard's pasteboardItems()
-- make a new pasteboard item to store existing item's stuff
set newPBItem to current application's NSPasteboardItem's alloc()'s init()
-- get the types of data stored on the pasteboard item
set theTypes to anItem's types()
-- for each type, get the corresponding data and store it all in the new pasteboard item
repeat with aType in theTypes
set theData to (anItem's dataForType:aType)'s mutableCopy()
if theData is not missing value then
(newPBItem's setData:theData forType:aType)
end if
end repeat
-- add new pasteboard item to array
(aMutableArray's addObject:newPBItem)
end repeat
return aMutableArray
end fetchStorableClipboard
Now, un-comment the very first line of this code:
use script "Myriad Tables Lib" version "1.0.8"
Once you compile your code, the following line:
set theTypes to anItem's types()
will automatically change to:
set theTypes to anItem's type {}
The issue is that types is changed to type. The effect is that this code no longer runs.
Does anyone know a workaround, or how to prevent this from occurring?
OS X El Capitan, version 10.11.6.
Best Answer
To get around this terminology conflict, use the following line:
Here's more info (from this webpage):
Note: