Search code examples
objective-ccocoamacosscripting-bridge

Having issues getting started with a ScriptingBridge Application Cocoa/Objective-C


I'm trying to use Scripting Bridge in my Mac OS app and am having difficulty implementing it. I've included the framework, and am intending to use it with Finder, so I've included a Finder.h file in my application as well.

I.E

#import <ScriptingBridge/ScriptingBridge.h>
#import "Finder.h"

However, whenever I call:

FinderApplication *finder = [SBApplication applicationWithBundleIdentifier:@"com.apple.Finder"];

I get the error

'FinderApplication' undeclared (first use in this function)

Are there any other things I need to do in order to get it working?

Thanks.


Solution

  • How did you generate the Finder.h file? I assume you used sdef like this:

    #!/bin/sh
    sdef /System/Library/CoreServices/Finder.app| sdp -fh --basename Finder
    

    If so, your code is similar to what I'm using successfully in my apps.