2

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.

mmmmmm
  • 32,227
  • 27
  • 88
  • 117
Andre
  • 21
  • 1
  • are you trying to communicate with FileMaker over AppleScript/AppleEvents in an Objective-C program, or something else? Do you already have what you want up and running in Applescript Studio? – pft221 Sep 22 '11 at 15:29
  • 1
    I have already completed the app in Applescript Studio with Applescript, but want to convert it to use the Scripting Bridge Framework. I don't want to use AppleScriptObjC though. Have a look here http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ScriptingBridgeConcepts/UsingScriptingBridge/UsingScriptingBridge.html#//apple_ref/doc/uid/TP40006104-CH4-DontLinkElementID_12 – Andre Sep 23 '11 at 18:38
  • 1
    the header files should provide some insight, can you post them? – Val Oct 29 '11 at 14:51
  • " can't get any further." Like what?. Please post your code of where you are so far and explain what next you are trying to do. – markhunte May 11 '14 at 20:44

1 Answers1

-1

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\" ..."];
Chuck
  • 4,662
  • 2
  • 33
  • 55