Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSWorkspaceMBS class.

Previous items Next items

NSWorkspaceMBS.NSWorkspaceDesktopImageScalingKey as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the keys for the options dictionary used with SetDesktopImageURL.

The value is an Number containing an NSImageScaling constant as declared in NSCell. If this is not specified, NSImageScaleProportionallyUpOrDown=3 is used. NSImageScaleProportionallyDown=0 is not currently supported.
Available in Mac OS X v10.6 and later.

NSWorkspaceMBS.NSWorkspaceDestroyOperation as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the file operation modes.

Destroy file.

NSWorkspaceMBS.NSWorkspaceDidActivateApplicationNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when the Finder is about to activate an application.
The notification object is the shared NSWorkspace instance. In Mac OS X v10.6 and later the userInfo dictionary contains the NSWorkspaceApplicationKey key with a corresponding instance of NSRunningApplication that represents the affected application.
Available in Mac OS X v10.6 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceDidChangeFileLabelsNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when the Finder file labels or colors change.
The notification object is the shared NSWorkspace instance. The notification does not contain a userInfo dictionary.
Available in Mac OS X v10.6 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceDidDeactivateApplicationNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when the Finder deactivated an application.
The notification object is the shared NSWorkspace instance. In Mac OS X v10.6 and later the userInfo dictionary contains the NSWorkspaceApplicationKey key with a corresponding instance of NSRunningApplication that represents the affected application.
Available in Mac OS X v10.6 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceDidHideApplicationNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when the Finder hid an application.
The notification object is the shared NSWorkspace instance. In Mac OS X v10.6 and later the userInfo dictionary contains the NSWorkspaceApplicationKey key with a corresponding instance of NSRunningApplication that represents the affected application.
Available in Mac OS X v10.6 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceDidLaunchApplicationNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when a new application has started up.
The notification object is the shared NSWorkspace instance. In Mac OS X v10.6 and later the userInfo dictionary contains the NSWorkspaceApplicationKey key with a corresponding instance of NSRunningApplication that represents the affected application.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceDidMountNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when a new device has been mounted.
The notification object is the shared NSWorkspace instance.

In Mac OS X v10.5 and earlier the userInfo dictionary contains a key @"NSDevicePath" that returns the path where the device was mounted, as a string.
Available in Mac OS X v10.0 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceDidPerformFileOperationNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when a file operation has been performed in the receiving application.
The notification object is the shared NSWorkspace instance. The userInfo dictionary contains a key "NSOperationNumber" with a number containing an integer indicating the type of file operation
Available in Mac OS X v10.0 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceDidRenameVolumeNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when a volume changes its name and/or mount path. These typically change simultaneously, in which case only one notification is posted.
The notification object is the shared NSWorkspace instance.
Available in Mac OS X v10.6 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceDidTerminateApplicationNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when an application finishes executing.
The notification object is the shared NSWorkspace instance. In Mac OS X v10.6 and later the userInfo dictionary contains the NSWorkspaceApplicationKey key with a corresponding instance of NSRunningApplication that represents the affected application.

Available in Mac OS X v10.0 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceDidUnhideApplicationNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when the Finder unhid an application.
The notification object is the shared NSWorkspace instance. In Mac OS X v10.6 and later the userInfo dictionary contains the NSWorkspaceApplicationKey key with a corresponding instance of NSRunningApplication that represents the affected application.
Available in Mac OS X v10.6 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceDidUnmountNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when the Finder did unmount a device.
This notification is delivered even if a volume was forcibly and immediately made unavailable, such as when a drive is simply unplugged.

The notification object is the shared NSWorkspace instance. The userInfo dictionary contains a key "NSDevicePath" that returns the path where the device was mounted, as a string.
Available in Mac OS X v10.0 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceDidWakeNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when the machine wakes from sleep.
The notification object is the shared NSWorkspace instance. The notification does not contain a userInfo dictionary.
Available in Mac OS X v10.3 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceDuplicateOperation as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the file operation modes.

Duplicate file in source directory.

NSWorkspaceMBS.NSWorkspaceEncryptOperation as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the file operation modes.

Encrypt file. This operation always returns an error.

NSWorkspaceMBS.NSWorkspaceLaunchConfigurationAppleEvent as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the keys for the configuration dictionary for launchApplication* methods.

The value is the first NSAppleEventDescriptor to send to the new application. If an instance of the application is already running, this is sent to that application.
Available in Mac OS X v10.6 and later.

NSWorkspaceMBS.NSWorkspaceLaunchConfigurationArchitecture as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the keys for the configuration dictionary for launchApplication* methods.

The value is a number containing an Mach-O Architecture constant. Ignored if a new instance of the application is not launched.
Available in Mac OS X v10.6 and later.
See NSBundleExecutableArchitecture* constants.

NSWorkspaceMBS.NSWorkspaceLaunchConfigurationArguments as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the keys for the configuration dictionary for launchApplication* methods.

The value is an NSArray of NSStrings, passed to the new application in the argv parameter. Ignored if a new instance of the application is not launched.
Available in Mac OS X v10.6 and later.

NSWorkspaceMBS.NSWorkspaceLaunchConfigurationEnvironment as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the keys for the configuration dictionary for launchApplication* methods.

The value is an dictionary, mapping Strings to Strings, containing environment variables to set for the new app. Ignored if a new instance of the application is not launched.
Available in Mac OS X v10.6 and later.

NSWorkspaceMBS.NSWorkspaceLinkOperation as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the file operation modes.
Example
dim f as FolderItem = SpecialFolder.Desktop.Child("test")
dim tag as Integer
dim files(-1) as string
dim b as Boolean
dim source,dest as FolderItem

// creates a hard link to a file in a folder

source=f.Parent
files.Append f.name
dest=SpecialFolder.Pictures

b=NSWorkspaceMBS.performFileOperation(NSWorkspaceMBS.NSWorkspaceLinkOperation, source, dest, files, tag)

if b then
MsgBox "OK"
else
MsgBox "Failed"
end if

Create hard link to file in destination.

NSWorkspaceMBS.NSWorkspaceMoveOperation as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the file operation modes.
Example
dim f as FolderItem = SpecialFolder.Desktop.Child("test")
dim tag as Integer
dim files(-1) as string
dim b as Boolean
dim source,dest as FolderItem

// moves a file from one folder to another folder

source=f.Parent
files.Append f.name
dest=SpecialFolder.Pictures

b=NSWorkspaceMBS.performFileOperation(NSWorkspaceMBS.NSWorkspaceMoveOperation, source, dest, files, tag)

if b then
MsgBox "OK"
else
MsgBox "Failed"
end if

Move file to destination.

NSWorkspaceMBS.NSWorkspaceRecycleOperation as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the file operation modes.
Example
dim f as FolderItem = SpecialFolder.Desktop.Child("test")
dim tag as Integer
dim files(-1) as string
dim b as Boolean
dim source,dest as FolderItem

source=f.Parent

files.Append f.name

b=NSWorkspaceMBS.performFileOperation(NSWorkspaceMBS.NSWorkspaceRecycleOperation, source, dest, files, tag)

if b then
MsgBox "OK"
else
MsgBox "Failed"
end if

Move file to trash. The file is moved to the trash folder on the volume containing the file using the same semantics as NSWorkspaceMoveOperation. If a file with the same name currently exists in the trash folder, the new file is renamed. If no trash folder exists on the volume containing the file, the operation fails.

NSWorkspaceMBS.NSWorkspaceScreensDidSleepNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when the machine's screen goes to sleep.
The notification object is the shared NSWorkspace instance. The notification does not contain a userInfo dictionary.

Few applications are likely to be interested in this notification, but they may be useful for certain hardware-based drawing decisions, for example when using OpenGL.

Available in Mac OS X v10.6 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceScreensDidWakeNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when the machine's screens wake.
The notification object is the shared NSWorkspace instance. The notification does not contain a userInfo dictionary.

Few applications are likely to be interested in this notification, but they may be useful for certain hardware-based drawing decisions, for example when using OpenGL.

Available in Mac OS X v10.6 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceSessionDidBecomeActiveNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted after a user session is switched in. This allows an application to re-enable some processing when a switched out session gets switched back in, for example.
The notification object is the shared NSWorkspace instance. The notification does not contain a userInfo dictionary.

Available in Mac OS X v10.3 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceSessionDidResignActiveNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted before a user session is switched out. This allows an application to disable some processing when its user session is switched out, and re-enable when that session gets switched back in, for example.
The notification object is the shared NSWorkspace instance. The notification does not contain a userInfo dictionary.

If an application is launched in an inactive session, NSWorkspaceSessionDidResignActiveNotification is sent after NSApplicationWillFinishLaunchingNotification and before sending NSApplicationDidFinishLaunchingNotification.

Available in Mac OS X v10.3 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceVolumeLocalizedNameKey as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the keys for the userinfo dictionary for the NSWorkspaceDidRenameVolumeNotification notification.

String containing the user-visible name of the volume.
Available in Mac OS X v10.6 and later.

NSWorkspaceMBS.NSWorkspaceVolumeOldLocalizedNameKey as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the keys for the userinfo dictionary for the NSWorkspaceDidRenameVolumeNotification notification.

String containing the old user-visible name of the volume
Available in Mac OS X v10.6 and later.

NSWorkspaceMBS.NSWorkspaceVolumeOldURLKey as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the keys for the userinfo dictionary for the NSWorkspaceDidRenameVolumeNotification notification.

URL containing the old mount path of the volume
Available in Mac OS X v10.6 and later.

NSWorkspaceMBS.NSWorkspaceVolumeURLKey as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the keys for the userinfo dictionary for the NSWorkspaceDidRenameVolumeNotification notification.

URL containing the mount path of the volume.
Available in Mac OS X v10.6 and later.

NSWorkspaceMBS.NSWorkspaceWillLaunchApplicationNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when the Finder is about to launch an application.
The notification object is the shared NSWorkspace instance. In Mac OS X v10.6 and later the userInfo dictionary contains the NSWorkspaceApplicationKey key with a corresponding instance of NSRunningApplication that represents the affected application.

Available in Mac OS X v10.0 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceWillPowerOffNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when the user has requested a logout or that the machine be powered off.
The notification object is the shared NSWorkspace instance. This notification does not contain a userInfo dictionary.
Available in Mac OS X v10.0 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceWillSleepNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted before the machine goes to sleep. An observer of this message can delay sleep for up to 30 seconds while handling this notification.
The notification object is the shared NSWorkspace instance. The notification does not contain a userInfo dictionary.

Available in Mac OS X v10.3 and later.

Some examples using this method:

NSWorkspaceMBS.NSWorkspaceWillUnmountNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
One of the notification names.

Posted when the Finder is about to unmount a device.
This notification will not be delivered if a volume was forcibly and immediately made unavailable, such as when a FireWire drive is simply unplugged, because there is no chance to deliver it before the volume becomes unavailable.

The notification object is the shared NSWorkspace instance. The userInfo dictionary contains a key "NSDevicePath" that returns the path where the device was mounted, as a string.
Available in Mac OS X v10.0 and later.

Some examples using this method:

NSWorkspaceMBS.openFile(file as folderitem) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 8.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Opens the specified file specified using the default application associated with its type.
Example
dim f as FolderItem

f=SpecialFolder.Desktop.Child("test.txt")

if NSWorkspaceMBS.openFile(f) then
MsgBox "Ok"
else
MsgBox "failed"
end if

Returns true if the file was successfully opened; otherwise, false.
The sending application is deactivated before the request is sent.

See also:

NSWorkspaceMBS.openFile(file as folderitem, appname as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 8.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Opens a file using the specified application.
Example
dim f as FolderItem
f=SpecialFolder.Desktop.Child("test.txt")

if NSWorkspaceMBS.openFile(f,"BBEdit") then
MsgBox "Ok"
else
MsgBox "failed"
end if

Returns true if the file was successfully opened; otherwise, false.

The appName parameter need not be specified with a full path and, in the case of an application wrapper, may be specified with or without the .app extension, as described in "Use of .app Extension". The sending application is deactivated before the request is sent.

See also:

NSWorkspaceMBS.openFile(file as folderitem, appname as string, Deactivate as boolean) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 8.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Opens the specified file and optionally deactivates the sending application.
Example
dim f as FolderItem = SpecialFolder.Desktop.Child("test.file")

if NSWorkspaceMBS.openFile(f,"BBEdit",true) then
MsgBox "Ok"
else
MsgBox "failed"
end if

appName: The name of the application to use when opening the file.

flag: If true, the sending application is deactivated before the request is sent, allowing the opening application to become the active application.

Returns true if the file was successfully opened; otherwise, false.

The appName parameter need not be specified with a full path and, in the case of an application wrapper, may be specified with or without the .app extension, as described in "Use of .app Extension". If appName is nil, the default application for the file's type is used.

See also:

NSWorkspaceMBS.openURL(url as string) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 8.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Opens the location at the specified URL.
Example
if NSWorkspaceMBS.openURL("http://www.apple.com") then
MsgBox "Ok"
else
MsgBox "failed"
end if

Returns true if the location was successfully opened; otherwise, false.

See also:

Some examples using this method:

NSWorkspaceMBS.openURL(url as string, bundleIdentifier as string, options as Integer = &h00030000, AppleEventDescriptor as Variant = nil) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Opens one or more files from an array of URLs.

url: A URL for the application to open.
bundleIdentifier: A bundle identifier string or "" to use the default system bindings. This value corresponds to the value in the CFBundleIdentifier key of the application's Info.plist file. For example, the bundle identifier of the TextEdit application is com.apple.TextEdit.
options: Options to use when launching the application. Values for this parameter are described in constants.
descriptor: Additional options specified in an AppleEvent-style descriptor. For example, you could use this parameter to specify additional documents to open when the application is launched.

Returns true if the application was found and launched; otherwise, false.

See also:

NSWorkspaceMBS.performFileOperation(operation as string, source as folderitem, destination as folderitem, files() as string, byref tag as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 9.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Performs a file operation on a set of files in a particular directory.

operation: The file operation to perform. The possible values for this parameter are described in "Constants."

source: The full path to the directory containing the files on which to operate.

destination: The full path to the destination directory of the operation.

files: An array of folderitems specifying the names of the files and directories to be manipulated. Each string must not contain any path information other than the name of the file or directory. In other words, all of the files and directories must be located in the source directory and not in one if its subdirectories.

tag: On input, a integer variable; on return, this variable contains a negative integer if the operation fails, 0 if he operation was performed synchronously and succeeded, or a positive integer if the operation was performed asynchronously. If the value is a positive integer, the value is a tag that identifies the requested file operation.

Return Value: True if the operation succeeded; otherwise, false.

Discussion:
Some operations—such as moving, copying, and linking files—require a destination directory to be specified. If not, destination should be the empty string (""). Before this method returns, it posts an NSWorkspaceDidPerformFileOperationNotification to the NSWorkspace object's notification center.

NSWorkspaceMBS.preferredFilenameExtensionForType(typeName as string) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacCocoa Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the preferred filename extension for the specified Uniform Type Identifier.
Example
MsgBox NSWorkspaceMBS.preferredFilenameExtensionForType("public.jpeg")
// "jpeg" in German

The appropriate filename extension for typeName, or "" if no extension could be determined.

Previous items Next items

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


The biggest plugin in space...