From 76424950e373d3b04ac3dd13019151bfba3e8423 Mon Sep 17 00:00:00 2001 From: sumuel Date: Mon, 17 Aug 2026 20:44:55 +0000 Subject: Add the files --- src/common/apple/osascript.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/common/apple/osascript.m (limited to 'src/common/apple/osascript.m') diff --git a/src/common/apple/osascript.m b/src/common/apple/osascript.m new file mode 100644 index 0000000..f17af03 --- /dev/null +++ b/src/common/apple/osascript.m @@ -0,0 +1,15 @@ +#include "osascript.h" + +#import + +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; +} -- cgit v1.2.3