Platforms to show: All Mac Windows Linux Cross-Platform

NSWorkspaceOpenConfigurationMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa MBS MacCocoa Plugin 26.1 ✅ Yes ❌ No ❌ No ❌ No All
The configuration options for opening URLs or launching apps.
Example
// open a file with a given application in the background
// MyWorkspace is a subclass of NSWorkspaceMBS with the openCompleted event implemented.
// Workspace is a property of the window: Workspace As MyWorkspace
Var config As New NSWorkspaceOpenConfigurationMBS
config.activates = False // keep our app in front
config.addsToRecentItems = False

Var file As FolderItem = SpecialFolder.Desktop.Child("test.txt")
Var app As FolderItem = SpecialFolder.Applications.Child("TextEdit.app")

Workspace = New MyWorkspace
Workspace.openFile file, app, config

// in MyWorkspace:
Sub openCompleted(item As Variant, application As Variant, configuration As NSWorkspaceOpenConfigurationMBS, runningApp As NSRunningApplicationMBS, error As NSErrorMBS, tag As Variant) Handles openCompleted
If error <> Nil Then
System.DebugLog "Failed: " + error.localizedDescription
End If
End Sub

Create an NSWorkspaceOpenConfigurationMBS object before launching an app or opening a URL using the shared NSWorkspaceMBS object. Use the properties of this object to customize the behavior of the launched app or the handling of the URLs. For example, you might tell the app to hide itself immediately after launch.

CPU Types

Constant Value Description
CPUTypeAny -1 Any CPU
CPUTypeARM 12 32-bit ARM
CPUTypeARM64 &h0100000C 64-bit ARM
CPUTypeX86 7 32-bit Intel
CPUTypeX86_64 &h01000007 64-bit Intel

This class has no subclasses.

Blog Entries

Release notes

Some methods using this class:

Some events using this class:

Some related classes:


The items on this page are in the following plugins: MBS MacCocoa Plugin.


NSWorkspaceMBS   -   NSXPCConnectionMBS


The biggest plugin in space...