Skip to main content
Participant
August 27, 2011
Question

Air application integration

  • August 27, 2011
  • 1 reply
  • 422 views

Would it be possible to integrate an AIR app into object-c application ?

I want to create an installation,in which there would be two applications,which can send parameters one to other ;object-c to AIR

This topic has been closed for replies.

1 reply

Participating Frequently
August 27, 2011

Hi,

Air applicatin provided with native installer is standard OS X application with .air runtime content. So - assuming that .e.g TourDeFlex:

http://www.adobe.com/devnet/flex/tourdeflex.html

(Adobe's flagship app for desktop) can eat startup arguments it could be launched (communicated) that way

NSString *appPath = [[NSWorkspace sharedWorkspace] fullPathForApplication:@"TourDeFlex.app"];

if(!appPath) return;

NSURL *url = [NSURL URLWithString:appPath];

NSArray *args = [NSArray arrayWithObjects:@"-show", @"exampleName", nil];

NSDictionary *options = [NSDictionary dictionaryWithObject:args

                                                    forKey:NSWorkspaceLaunchConfigurationArguments];

NSError *launchError = nil;

[[NSWorkspace sharedWorkspace] launchApplicationAtURL:url

                                              options:NSWorkspaceLaunchDefault

                                        configuration:options

                                                error:&launchError];

if(launchError) {

    // handle launch error

}

https://gist.github.com/1175967

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSWorkspace_Class/Reference/Reference.html

(get path knowing only name of app, construct URL path, construct arguments and ask system [a.k.a. workspace] to launch TourDeFlex)

hth,

kind regards,

Peter