So with CTypes Im tryng to convert this code below. It uses OSType
, OSType is dfined as
FourCharCode = ctypes.c_uint32
OSType = FourCharCode
QTPropertyClass = OSType
We see here it is an usngiend character. But We see in snippet below they defined it as
const OSType kFinderSig = 'MACS';
So in ctypes, setting a variable to 'MACS'
would not e c_uint32 type but it will be char no?
Please advise.
Thanks
https://stackoverflow.com/a/8895297/1828637
OSStatus SendFinderSyncEvent( const FSRef* inObjectRef )
{
AppleEvent theEvent = { typeNull, NULL };
AppleEvent replyEvent = { typeNull, NULL };
AliasHandle itemAlias = NULL;
const OSType kFinderSig = 'MACS';
OSStatus err = FSNewAliasMinimal( inObjectRef, &itemAlias );
if (err == noErr)
{
err = AEBuildAppleEvent( kAEFinderSuite, kAESync, typeApplSignature,
&kFinderSig, sizeof(OSType), kAutoGenerateReturnID,
kAnyTransactionID, &theEvent, NULL, "'----':alis(@@)", itemAlias );
if (err == noErr)
{
err = AESendMessage( &theEvent, &replyEvent, kAENoReply,
kAEDefaultTimeout );
AEDisposeDesc( &replyEvent );
AEDisposeDesc( &theEvent );
}
DisposeHandle( (Handle)itemAlias );
}
return err;
}