I have working Objective-C code that uses ScriptingBridge to make Safari open a URL. Something like:
#import "Safari.h" /* created by executing "sdef /Applications/Google\ Chrome.app | sdp -fh --basename GoogleChrome" */
if ((safariApp = [SBApplication applicationWithBundleIdentifier:@"com.apple.Safari"]) == nil) {
NSLog(@"couldn't access Google Chrome");
} else {
NSString *theUrl = [NSString stringWithUTF8String:"http://www.ford.com"];
NSDictionary *theProperties = [NSDictionary dictionaryWithObject:theUrl forKey:@"URL"];
SafariDocument *doc = [[[safariApp classForScriptingClass:@"document"] alloc] initWithProperties:theProperties];
[[safariApp documents] addObject:doc];
}
I'd like to create similar code that will do the same thing for Chrome instead of Safari. Obviously I need to change "Safari.h" to "GoogleChrome.h" and "com.apple.Safari" to "com.google.Chrome". I'm not sure how to change the last three lines - there's no definition of "GoogleDocument" in GoogleChrome.h