Does ASObj-C work with core foundation? If so, is there any reason to learn about the framework? I looked at the functions in core foundation (it seems like it’s all functions in core foundation) and nothing in there seemed all that useful given ASObj-C users have access to AppleScript functionality and the foundation framework.
I tried woking with core foundation in AppleScript but I could never get anything to work. I tried a lot of things, here is a list of a few of them to show the kind of errors I got. I thought the tool free __NSCFString could somehow be coerced to a CFString but I could never get it to work.
use framework "CoreFoundation" -- This got an error trying to convert to type CFString set TheVar to current application's NSString's stringWithString:"test" --> (NSString) "test" TheVar's className() as __CFString --> (NSString) "__NSCFString" current application's CFString's CFStringGetLength(TheVar) --This got the error CFStringCreateWithCharacters unable to set argument 1 - the AppleScript value -- <NSAppleEventDescriptor: 'utxt'("TheVar")> could not be coerced to type S. CFStringCreateWithCharacters(missing value, "TheVar", 4) -- Got error CFString doesn’t understand the “CFStringCreateWithCharacters_” message. current application's CFString's CFStringCreateWithCharacters_(missing value, "Test", 4)