0
我想用MacRuby設置我的用戶的通訊簿圖像。這是我到目前爲止:用MacRuby設置通訊錄圖像
framework 'ScriptingBridge'
framework 'AppKit'
download = "/path.png"
data = NSData.dataWithContentsOfFile(download)
bitmap = NSBitmapImageRep.imageRepWithData(data)
final = bitmap.representationUsingType(NSTIFFFileType, properties: nil)
book = SBApplication.applicationWithBundleIdentifier("com.apple.addressbook")
book.myCard.setImage(final)
我也試過book.myCard.setImage(final.base64Encoding)
,順便說一下。
我需要做些什麼來完成這項工作?
謝謝!
完美!很棒! – dejay