I'm new to Externals and I don't understand anything about objective-c stuff but I'm trying to get the icon of a MacOS Finder file to populate the imageData of a LC image control.
I built a script by copying bits found on the net but my problem concerns the final step: returning data that can be used by LC. I would like something like:
Code: Select all
set the imageData of image "MyImage" to MyExternal("/path to a file")
Code: Select all
put ObjC_NSBitmapImageRepRepresentationUsingType(tBitmapImageRep, 4, nothing) into tImageData // 4 for PNG
put DataFromNSData(tImageData) into dataResult // ???
return what ???
Code: Select all
private foreign handler ObjC_NSBitmapImageRepRepresentationUsingType(in pBitmapImageRep as ObjcId, in pType as CInt, in pProps as optional ObjcId) \
returns ObjcId binds to "objc:NSBitmapImageRep.-representationUsingType:properties:"