Instance Method

openURLs:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:

Opens one or more files from an array of URLs.

Declaration

- (BOOL)openURLs:(NSArray<NSURL *> *)urls withAppBundleIdentifier:(NSString *)bundleIdentifier options:(NSWorkspaceLaunchOptions)options additionalEventParamDescriptor:(NSAppleEventDescriptor *)descriptor launchIdentifiers:(NSArray<NSNumber *> * _Nullable *)identifiers;

Parameters

urls

An array of NSURL objects, each one identifying a URL for the app to open.

bundleIdentifier

A bundle identifier string or nil to use the default system bindings. This value corresponds to the value in the CFBundleIdentifier key of the app’s Info.plist file. For example, the bundle identifier of the TextEdit app is com.apple.TextEdit.

options

Options to use when launching the app. Values for this parameter are described in NSWorkspaceLaunchOptions.

descriptor

Additional options specified in an AppleEvent-style descriptor. For example, you could use this parameter to specify additional documents to open when the app is launched.

identifiers

The launchIdentifiers are currently unused, and you should pass NULL.

Return Value

YES if the app was found and launched; otherwise, NO.

Discussion

It is safe to call this method from any thread of your app.

See Also

Working with Bundles

- absolutePathForAppBundleWithIdentifier:

Returns the absolute file-system path of an app bundle.

- launchAppWithBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifier:

Launches the app corresponding to the specified bundleIdentifier.