Objective C 脚本桥与 FileMaker Pro 11

发布于 2024-12-05 14:27:32 字数 222 浏览 0 评论 0原文

我正在尝试使用脚本桥与 FileMaker pro 11 进行通信,我可以让它启动应用程序,打开正确的数据库文件,但无法进一步进行。

有没有人有 FileMaker Pro 的示例脚本桥文件,一旦我能够了解两者之间的通信,我应该没问题。

我想将用 Applescript Studio 编写的应用程序转换为 Objective C。 我了解 Objective C,但可以了解 FMP 之间的通信。

I'm trying to use scripting bridge to communicate with FileMaker pro 11, I can get it to launch the App, open the correct database file but can't get any further.

Has anyone got an example scripting bridge file for FileMaker Pro, once I can get my head around the communication between the 2 I should be OK.

I want to convert my app written in Applescript Studio to Objective C.
I know Objective C but can get my head around the communication between FMP.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

萌面超妹 2024-12-12 14:27:32

不久前,我必须使用 AppleScript 从 Cocoa 应用程序控制 iTunes,我使用了 NSAppleScript。我不知道脚本桥,我会看一下它,但使用 NSAppleScript 非常简单:

NSString *source = @"tell application \"iTunes\" to set sound volume to sound volume - 1";
NSAppleScript *script = [[NSAppleScript alloc] initWithSource:source];
[script executeAndReturnError:nil];

我以这种方式控制 iTunes 从来没有遇到过任何问题,我确信它也适用于 FileMaker。

我要提到的一件事是使用以下方法在 NSAppleScript 上创建一个类别,这使得编写代码变得更加容易:

+ (NSAppleEventDescriptor *)executeWithSource:(NSString *)source {
  NSAppleScript *script = [[NSAppleScript alloc] initWithSource:source];
  return [script executeAndReturnError:nil];
}

这将我的脚本代码变成

[NSAppleScript executeWithSource:@"tell application \"iTunes\" ..."];

A while back I had to control iTunes from a Cocoa app using AppleScript and I used NSAppleScript. I wasn't aware of the Scripting Bridge, and I'll take a look at it, but it was pretty straightforward with NSAppleScript:

NSString *source = @"tell application \"iTunes\" to set sound volume to sound volume - 1";
NSAppleScript *script = [[NSAppleScript alloc] initWithSource:source];
[script executeAndReturnError:nil];

I never had any trouble controlling iTunes in this manner and I'm sure it would work with FileMaker as well.

One thing I'll mention that made writing the code a tiny bit easier was creating a category on NSAppleScript with the following method:

+ (NSAppleEventDescriptor *)executeWithSource:(NSString *)source {
  NSAppleScript *script = [[NSAppleScript alloc] initWithSource:source];
  return [script executeAndReturnError:nil];
}

That turned my scripting code into

[NSAppleScript executeWithSource:@"tell application \"iTunes\" ..."];
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文