Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSAppleEventDescriptorMBS class.

NSAppleEventDescriptorMBS.descriptorWithAlias(item as folderitem) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 11.3 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor initialized with type typeAlias that stores the specified folderitem reference.
Example
// pick a folderitem
Var folder as FolderItem = SpecialFolder.Desktop

// create value with file reference
Var d as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithAlias(folder)

// convert back to FolderItem
Var file as FolderItem = d.FSRefValue

// show path
MsgBox file.NativePath

This type can be converted internally to FSRef descriptor.

NSAppleEventDescriptorMBS.descriptorWithApplicationURL(fileURL as string) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 16.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Create and return an application address descriptor using the file URL for an application.
Example
Var f as FolderItem = SpecialFolder.Applications.Child("Stickies.app")
Var u as string = f.URLPath
Var d as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithApplicationURL(u)
MsgBox d.applicationURLValue

The result is suitable for use as the "targetDescriptor" parameter of appleEventWithEventClass.

See also:

NSAppleEventDescriptorMBS.descriptorWithApplicationURL(item as folderitem) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 16.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Create and return an application address descriptor using the folderitem for an application.
Example
Var f as FolderItem = SpecialFolder.Applications.Child("Stickies.app")
Var d as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithApplicationURL(f)
MsgBox d.applicationURLValue

The result is suitable for use as the "targetDescriptor" parameter of appleEventWithEventClass.

See also:

NSAppleEventDescriptorMBS.descriptorWithBoolean(value as Boolean) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor initialized with type typeBoolean that stores the specified Boolean value.
Example
Var a as NSAppleEventDescriptorMBS
a = NSAppleEventDescriptorMBS.descriptorWithBoolean(true)
MsgBox a.stringValue // shows true

Returns a descriptor with the specified Boolean value, or nil if an error occurs.

NSAppleEventDescriptorMBS.descriptorWithBundleIdentifier(BundleID as String) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 16.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Create and return an application address descriptor using the bundle identifier.
Example
Var d as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithBundleIdentifier("com.apple.iCal")
MsgBox d.bundleIDValue

The result is suitable for use as the "targetDescriptor" parameter of appleEventWithEventClass.

Some examples using this method:

NSAppleEventDescriptorMBS.descriptorWithCurrentProcessSerialNumber as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 16.0 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates descriptor with current process serial number.
Example
Var n as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithCurrentProcessSerialNumber
MsgBox n.stringValue // shows app name

NSAppleEventDescriptorMBS.descriptorWithDate(value as date) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor with a date value.
Example
Var d as new date
Var n as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithDate(d)

Var x as date = n.dateValue
MsgBox x.LongDate+" "+x.LongTime // shows today

NSAppleEventDescriptorMBS.descriptorWithDateTime(value as dateTime) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 20.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor with a date value.

NSAppleEventDescriptorMBS.descriptorWithDescriptorType(descriptorType as string, data as memoryblock) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor initialized with the specified event type that stores the specified data.

descriptorType: The descriptor type to be set in the returned descriptor.
data: The data, as a memoryblock, to be set in the returned descriptor.

Returns a descriptor with the specified type and data, or nil if an error occurs.

You can use this method to create a descriptor that you can build into a complete Apple event by calling methods such as setAttributeDescriptor, setDescriptor, and setParamDescriptor.

See also:

NSAppleEventDescriptorMBS.descriptorWithDescriptorType(descriptorType as string, data as memoryblock, offset as UInt32, length as UInt32) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor initialized with the specified event type that stores the specified data (from a series of bytes).

descriptorType: The descriptor type to be set in the returned descriptor.
bytes: The data, as a sequence of bytes, to be set in the returned descriptor.
offset: offset in memoryblock.
length: The length, in bytes, of the data to be set in the returned descriptor.

Returns a descriptor with the specified type and data, or nil if an error occurs.

See also:

NSAppleEventDescriptorMBS.descriptorWithDouble(value as Double) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor with a double value.
Example
Var a as NSAppleEventDescriptorMBS
a = NSAppleEventDescriptorMBS.descriptorWithDouble(5)
MsgBox a.stringValue // shows 5

NSAppleEventDescriptorMBS.descriptorWithEnumCode(enumerator as string) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor initialized with type typeEnumerated that stores the specified enumerator data type value.

enumerator: A type code that identifies the type of enumerated data to be stored in the returned descriptor.

Returns a descriptor with the specified enumerator data type value, or nil if an error occurs.

NSAppleEventDescriptorMBS.descriptorWithFileURL(fileURL as string) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 16.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor for a file URL.
Example
Var f as FolderItem = SpecialFolder.Applications.Child("Stickies.app")
Var u as string = f.URLPath
Var d as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithFileURL(u)
MsgBox d.fileURLValue

See also:

Some examples using this method:

NSAppleEventDescriptorMBS.descriptorWithFileURL(item as folderitem) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 16.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor for a file URL based on the folderitem.
Example
Var f as FolderItem = SpecialFolder.Applications.Child("Stickies.app")
Var d as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithFileURL(f)
MsgBox d.fileURLValue

See also:

NSAppleEventDescriptorMBS.descriptorWithInt16(value as Int16) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor initialized with Apple event type typeSInt16 that stores the specified integer value.
Example
Var a as NSAppleEventDescriptorMBS

a = NSAppleEventDescriptorMBS.descriptorWithInt16(5)

MsgBox a.stringValue // shows 5

NSAppleEventDescriptorMBS.descriptorWithInt32(value as Int32) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor initialized with Apple event type typeSInt32 that stores the specified integer value.
Example
Var a as NSAppleEventDescriptorMBS
a = NSAppleEventDescriptorMBS.descriptorWithInt32(5)

MsgBox a.stringValue // shows 5

Returns a descriptor containing the specified integer value, or nil if an error occurs.

NSAppleEventDescriptorMBS.descriptorWithProcessIdentifier(PID as Integer) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 16.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Create and return an application address descriptor using the process identifier.
Example
// get my PID
Var p as new ProcessMBS
p.GetCurrentProcess
Var pid as Integer = p.ProcessID

// make process ID descriptor
Var n as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithProcessIdentifier(pid)

// show it
MsgBox "ProcessID: "+str(n.processIDValue) + EndOfLine + n.stringValue

The result is suitable for use as the "targetDescriptor" parameter of appleEventWithEventClass.

NSAppleEventDescriptorMBS.descriptorWithSingle(value as single) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor with a single value.
Example
Var a as NSAppleEventDescriptorMBS
a = NSAppleEventDescriptorMBS.descriptorWithSingle(5)
MsgBox a.stringValue // shows 5

NSAppleEventDescriptorMBS.descriptorWithString(text as string) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor initialized with type typeUnicodeText that stores the text from the specified string.
Example
Var a as NSAppleEventDescriptorMBS
a = NSAppleEventDescriptorMBS.descriptorWithString("Hello World")

MsgBox a.stringValue

Returns a descriptor that contains the text from the specified string, or nil if an error occurs.

Some examples using this method:

NSAppleEventDescriptorMBS.descriptorWithTypeCode(typeCode as string) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor initialized with type typeType that stores the specified type value.

typeCode: The type value to be set in the returned descriptor.

Returns a descriptor with the specified type, or nil if an error occurs.

NSAppleEventDescriptorMBS.descriptorWithUInt32(value as UInt32) as NSAppleEventDescriptorMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates a descriptor with an unsigned integer value.
Example
Var a as NSAppleEventDescriptorMBS
a = NSAppleEventDescriptorMBS.descriptorWithUInt32(5)
MsgBox a.stringValue // shows 5

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


The biggest plugin in space...