I am trying to set my user's Address Book Image with MacRuby. Here is what I have so far:
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)
I have also tried book.myCard.setImage(final.base64Encoding)
, by the way.
What do I need to do to make this work?
Thanks!