Files
fastfetch/src/common/apple/osascript.m
T
李通洲 383a4190ca Comon (macOS): tidy
Co-authored-by: Copilot <copilot@github.com>
2026-04-30 13:26:46 +08:00

16 lines
425 B
Objective-C

#include "osascript.h"
#import <Foundation/Foundation.h>
bool ffOsascript(const char* input, FFstrbuf* result)
{
NSAppleScript* script = [NSAppleScript.alloc initWithSource:@(input)];
NSDictionary* errInfo = nil;
NSAppleEventDescriptor* descriptor = [script executeAndReturnError:&errInfo];
if (errInfo)
return false;
ffStrbufSetS(result, descriptor.stringValue.UTF8String);
return true;
}