我正在寻找 AppleScriptObjC 的方法,并且发现 Shane Stanley 的Everyday AppleScriptObjC很有帮助。但我仍然很难知道从哪里开始NSPasteboard
。
这是我到目前为止所拥有的:
use AppleScript version "2.4"
use framework "Foundation"
use framework "AppKit"
use scripting additions
on readClipboard(theClipboard)
set theClipboard to current application's NSPasteboard
return theClipboard as text
end readClipboard
set theContents to missing value
its readClipboard(theContents)
当然,这是行不通的。但它似乎确实在做些什么。
它返回:
error "Can’t make «class ocid» id «data optr000000002852F974FF7F0000» into type text." number -1700 from «class ocid» id «data optr000000002852F974FF7F0000» to text
任何指针将不胜感激。