Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSWorkspaceMBS class.

NSWorkspaceMBS.duplicateFiles(files() as FolderItem, tag as variant = nil)   New in 26.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 26.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Duplicates the specified files asynchronously in the same manner as the Finder.

files: An array of FolderItem objects representing the files to duplicate. This parameter must not be nil.

Calls duplicateCompleted later when done.

This method may cause a progress indicator, or other user interface element, to be shown by the Finder.

In macOS 10.6, this method requires the app to run its main run loop in a common mode. You can safely call this method from any thread of your app.

NSWorkspaceMBS.openApplicationFile(Application as FolderItem, configuration as NSWorkspaceOpenConfigurationMBS, tag as variant = nil)   New in 26.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 26.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Launches the app at the specified URL and asynchronously reports back on the app’s status.

application: A FolderItem specifying the location of the app in the file system.
configuration: The options that indicate how you want to launch the app.

Calls OpenCompleted event later.

NSWorkspaceMBS.openApplicationURL(ApplicationURL as String, configuration as NSWorkspaceOpenConfigurationMBS, tag as variant = nil)   New in 26.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 26.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Launches the app at the specified URL and asynchronously reports back on the app’s status.

applicationURL: A URL specifying the location of the app in the file system.
configuration: The options that indicate how you want to launch the app.

Calls OpenCompleted event later.

NSWorkspaceMBS.openFile(File as FolderItem, Application as FolderItem, configuration as NSWorkspaceOpenConfigurationMBS, tag as variant = nil)   New in 26.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 26.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Opens a file asynchronously using the provided options.

File: The file to open.
application: A folderitem specifying the location of the app in the file system.
configuration: The options that indicate how you want to open the URL.

Calls OpenCompleted event later.

You may call this method safely from any thread of your app.

See also:

NSWorkspaceMBS.openFile(File as FolderItem, configuration as NSWorkspaceOpenConfigurationMBS, tag as variant = nil)   New in 26.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 26.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Opens a file asynchronously using the provided options.
Example
Var test As FolderItem = SpecialFolder.Desktop.Child("test.rtf")
Var workspace As New NSWorkspaceMBS
Var config As New NSWorkspaceOpenConfigurationMBS
config.architecture = config.CPUTypeX86_64
config.hidesOthers = True
config.promptsUserIfNeeded = true

workspace.openFile test, config

File: The file to open.
configuration: The options that indicate how you want to open the URL.

Calls OpenCompleted event later.

You may call this method safely from any thread of your app.

See also:

NSWorkspaceMBS.openURL(URL as String, ApplicationURL as String, configuration as NSWorkspaceOpenConfigurationMBS, tag as variant = nil)   New in 26.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 26.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Opens a URL asynchronously using the provided options.

url: The URL to open.
applicationURL: A URL specifying the location of the app in the file system.
configuration: The options that indicate how you want to open the URL.

Calls OpenCompleted event later.

You may call this method safely from any thread of your app.

See also:

NSWorkspaceMBS.openURL(URL as String, configuration as NSWorkspaceOpenConfigurationMBS, tag as variant = nil)   New in 26.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 26.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Opens a URL asynchronously using the provided options.

url: The URL to open.
configuration: The options that indicate how you want to open the URL.

Calls OpenCompleted event later.

You may call this method safely from any thread of your app.

See also:

NSWorkspaceMBS.recycleFiles(files() as FolderItem, tag as variant = nil)   New in 26.1

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 26.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Moves the specified URLs to the trash in the same manner as the Finder.

files: An array of FolderItem objects representing the files to move to the trash. This parameter must not be nil.

Calls recycleCompleted later when done.

This method may cause a progress indicator, or other user interface element, to be shown by the Finder.

In macOS 10.6, this method requires the app to run the main run loop in a common mode to facilitate the display of any user interface elements. You can safely call this method from any thread of your app.

NSWorkspaceMBS.requestAuthorization(type as integer, tag as variant = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacCocoa Plugin 19.3 ✅ Yes ❌ No ❌ No ❌ No Desktop only
Requests authorization to perform a privileged file operation.

type: The type of file operation to perform.

Calls requestAuthorizationCompleted event later.
Tag value is passed through as is to event.

Requires the application to be code-signed.

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


The biggest plugin in space...