Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

NSAppleEventDescriptorMBS.appleEventWithEventClass(eventClass as string, eventID as string, targetDescriptor as NSAppleEventDescriptorMBS, returnID as Int16, transactionID as UInt32) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Creates a descriptor that represents an Apple event, initialized according to the specified information.
Notes:
eventClass: The event class to be set in the returned descriptor.
eventID: The event ID to be set in the returned descriptor.
addressDescriptor: A pointer to a descriptor that identifies the target application for the Apple event. Passing nil results in an Apple event descriptor that has no keyAddressAttr attribute (it is valid for an Apple event to have no target address attribute).
returnID: The return ID to be set in the returned descriptor. If you pass a value of kAutoGenerateReturnID, the Apple Event Manager assigns the created Apple event a return ID that is unique to the current session. If you pass any other value, the Apple Event Manager assigns that value for the ID.
transactionID: The transaction ID to be set in the returned descriptor. A transaction is a sequence of Apple events that are sent back and forth between client and server applications, beginning with the client's initial request for a service. All Apple events that are part of a transaction must have the same transaction ID. You can specify kAnyTransactionID if the Apple event is not one of a series of interdependent Apple events.

Returns a descriptor for an Apple event, initialized according to the specified parameter values, or nil if an error occurs.

Constants such as kAutoGenerateReturnID and kAnyTransactionID are defined in AE.framework, a subframework of ApplicationServices.framework.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.currentProcessDescriptor as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 16.2 Yes No No Yes, macOS only No
Function: Create and return an application address descriptor using the current process.
Example:
dim d as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.currentProcessDescriptor
MsgBox "Process ID: "+str(d.processIDValue)
Notes: The result is suitable for use as the "targetDescriptor" parameter of appleEventWithEventClass.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorWithAlias(item as folderitem) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 11.3 Yes No No Yes, macOS only No
Function: Creates a descriptor initialized with type typeAlias that stores the specified folderitem reference.
Example:
// pick a folderitem
dim folder as FolderItem = SpecialFolder.Desktop

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

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

// show path
MsgBox file.AbsolutePath
Notes: This type can be converted internally to FSRef descriptor.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorWithApplicationURL(fileURL as string) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 16.2 Yes No No Yes, macOS only No
Function: Create and return an application address descriptor using the file URL for an application.
Example:
dim f as FolderItem = SpecialFolder.Applications.Child("Stickies.app")
dim u as string = f.URLPath
dim d as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithApplicationURL(u)
MsgBox d.applicationURLValue
Notes: The result is suitable for use as the "targetDescriptor" parameter of appleEventWithEventClass.

See also:

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorWithApplicationURL(item as folderitem) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 16.2 Yes No No Yes, macOS only No
Function: Create and return an application address descriptor using the folderitem for an application.
Example:
dim f as FolderItem = SpecialFolder.Applications.Child("Stickies.app")
dim d as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithApplicationURL(f)
MsgBox d.applicationURLValue
Notes: The result is suitable for use as the "targetDescriptor" parameter of appleEventWithEventClass.

See also:

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorWithBoolean(value as Boolean) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Creates a descriptor initialized with type typeBoolean that stores the specified Boolean value.
Example:
dim a as NSAppleEventDescriptorMBS
a = NSAppleEventDescriptorMBS.descriptorWithBoolean(true)
MsgBox a.stringValue // shows true
Notes: Returns a descriptor with the specified Boolean value, or nil if an error occurs.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorWithBundleIdentifier(BundleID as String) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 16.2 Yes No No Yes, macOS only No
Function: Create and return an application address descriptor using the bundle identifier.
Example:
dim d as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithBundleIdentifier("com.apple.iCal")
MsgBox d.bundleIDValue
Notes: The result is suitable for use as the "targetDescriptor" parameter of appleEventWithEventClass.

Feedback, Comments & Corrections

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

Feedback, Comments & Corrections

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

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

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorWithDescriptorType(descriptorType as string, data as memoryblock) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Creates a descriptor initialized with the specified event type that stores the specified data.
Notes:
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:

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorWithDescriptorType(descriptorType as string, data as memoryblock, offset as UInt32, length as UInt32) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Creates a descriptor initialized with the specified event type that stores the specified data (from a series of bytes).
Notes:
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:

Feedback, Comments & Corrections

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

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorWithEnumCode(enumerator as string) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Creates a descriptor initialized with type typeEnumerated that stores the specified enumerator data type value.
Notes:
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.

Feedback, Comments & Corrections

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

See also:

Feedback, Comments & Corrections

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

See also:

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorWithFSRef(item as folderitem) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 11.3 Yes No No Yes, macOS only No
Function: Creates a descriptor initialized with type typeFSRef that stores the specified folderitem reference.
Example:
// pick a folderitem
dim folder as FolderItem = SpecialFolder.Desktop

// create value with file reference
dim d as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithFSRef(folder)

// show path
MsgBox d.stringValue

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

// show path
MsgBox file.AbsolutePath
Notes: This type can be converted internally to Alias or String descriptor.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorWithInt16(value as Int16) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Creates a descriptor initialized with Apple event type typeSInt16 that stores the specified integer value.
Example:
dim a as NSAppleEventDescriptorMBS

a = NSAppleEventDescriptorMBS.descriptorWithInt16(5)

MsgBox a.stringValue // shows 5

Feedback, Comments & Corrections

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

MsgBox a.stringValue // shows 5
Notes: Returns a descriptor containing the specified integer value, or nil if an error occurs.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorWithProcessIdentifier(PID as Integer) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 16.2 Yes No No Yes, macOS only No
Function: Create and return an application address descriptor using the process identifier.
Example:
// get my PID
dim p as new ProcessMBS
p.GetCurrentProcess
dim pid as Integer = p.ProcessID

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

// show it
MsgBox "ProcessID: "+str(n.processIDValue) + EndOfLine + n.stringValue
Notes: The result is suitable for use as the "targetDescriptor" parameter of appleEventWithEventClass.

Feedback, Comments & Corrections

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

Feedback, Comments & Corrections

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

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

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorWithTypeCode(typeCode as string) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Creates a descriptor initialized with type typeType that stores the specified type value.
Notes:
typeCode: The type value to be set in the returned descriptor.

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

Feedback, Comments & Corrections

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

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.listDescriptor as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Creates and initializes an empty list descriptor.
Notes:
Returns an empty list descriptor, or nil if an error occurs.

A list descriptor is a descriptor whose data consists of one or more descriptors. You can add items to the list by calling insertDescriptor or remove them with removeDescriptorAtIndex.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.nullDescriptor as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Creates and initializes a descriptor with no parameter or attribute values set.
Notes:
Returns a descriptor with no parameter or attribute values set, or nil if an error occurs.

You don't typically call this method, as most NSAppleEventDescriptor instance methods can't be safely called on the returned empty descriptor.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.recordDescriptor as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Creates and initializes a descriptor for an Apple event record whose data has yet to be set.
Notes:
Returns an Apple event descriptor whose data has yet to be set, or nil if an error occurs.

An Apple event record is a descriptor whose data is a set of descriptors keyed by four-character codes. You can add information to the descriptor with methods such as setAttributeDescriptor, setDescriptor, and setParamDescriptor.

Feedback, Comments & Corrections

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




Links
MBS Xojo blog