mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
383a4190ca
Co-authored-by: Copilot <copilot@github.com>
16 lines
425 B
Objective-C
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;
|
|
}
|