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.attributeDescriptorForKeyword(keyword as string) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Returns a descriptor for the receiver's Apple event attribute identified by the specified keyword.
Notes:
keyword: A keyword (a four-character code) that identifies the descriptor to obtain.

Returns the attribute descriptor for the specified keyword, or nil if an error occurs.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.coerceToDescriptorType(descriptorType as string) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Returns a descriptor obtained by coercing the receiver to the specified type.
Notes:
descriptorType: The descriptor type to coerce the receiver to.

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

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 13.1 Yes No No Yes, macOS only No
Function: The private constructor.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.copy as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Creates a copy of the apple event descriptor.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorAtIndex(index as Integer) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Returns the descriptor at the specified (one-based) position in the receiving descriptor list.
Example:
dim n as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.listDescriptor
dim d as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithString("Hello")
dim e as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithString("World")

n.insertDescriptor(d,1)
n.insertDescriptor(e,2)

MsgBox str(n.numberOfItems)

dim x1 as NSAppleEventDescriptorMBS = n.descriptorAtIndex(1)
dim x2 as NSAppleEventDescriptorMBS = n.descriptorAtIndex(2)
MsgBox x1.stringValue+" "+x2.stringvalue
Notes:
Index: The one-based descriptor list position of the descriptor to return.

Returns the descriptor from the specified position (one-based) in the descriptor list, or nil if the specified descriptor cannot be obtained.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.descriptorForKeyword(keyword as string) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Returns the receiver's descriptor for the specified keyword.
Example:
dim n as new NSAppleScriptMBS("return system info")
dim r as NSAppleEventDescriptorMBS = n.execute

dim lines(-1) as string

dim u as Integer = r.numberOfItems
for i as Integer = 1 to u
dim keyword as string = r.keywordForDescriptorAtIndex(i)
dim value as string
dim p as NSAppleEventDescriptorMBS = r.descriptorForKeyword(keyword)
if p<>Nil then value = p.stringValue
lines.Append keyword+": "+value
next

MsgBox Join(lines,EndOfLine)
Notes:
keyword: A keyword (a four-character code) that identifies the descriptor to obtain.

Returns a descriptor for the specified keyword, or nil if an error occurs.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.insertDescriptor(descriptor as NSAppleEventDescriptorMBS, index as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Inserts a descriptor at the specified (one-based) position in the receiving descriptor list, replacing the existing descriptor, if any, at that position.
Notes:
descriptor: The descriptor to insert in the receiver. Specifying an index of 0 or count + 1 causes appending to the end of the list.
Index: The one-based descriptor list position at which to insert the descriptor.

Because it actually replaces the descriptor, if any, at the specified position, this method might better be called replaceDescriptor. The receiver must be a list descriptor. The indices are one-based. Currently provides no indication if an error occurs.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.keywordForDescriptorAtIndex(index as Integer) as string
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Returns the keyword for the descriptor at the specified (one-based) position in the receiver.
Example:
dim n as new NSAppleScriptMBS("return system info")
dim r as NSAppleEventDescriptorMBS = n.execute

dim lines(-1) as string

dim u as Integer = r.numberOfItems
for i as Integer = 1 to u
dim keyword as string = r.keywordForDescriptorAtIndex(i)
dim value as string
dim p as NSAppleEventDescriptorMBS = r.descriptorForKeyword(keyword)
if p<>Nil then value = p.stringValue
lines.Append keyword+": "+value
next

MsgBox Join(lines,EndOfLine)
Notes:
Index: The one-based descriptor list position of the descriptor to get the keyword for.

Returns the keyword (a four-character code) for the descriptor at the one-based location specified by anIndex, or 0 if an error occurs.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.paramDescriptorForKeyword(keyword as string) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Returns a descriptor for the receiver's Apple event parameter identified by the specified keyword.
Notes:
keyword: A keyword (a four-character code) that identifies the parameter descriptor to obtain.

Returns a descriptor for the specified keyword, or nil if an error occurs.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.print
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 12.1 Yes No No Yes, macOS only No
Function: Writes description for this event descriptor to the console.
Notes: You can see result in Console.app.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.removeDescriptorAtIndex(index as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Removes the descriptor at the specified (one-based) position in the receiving descriptor list.
Notes:
Index: The one-based position of the descriptor to remove.

The receiver must be a list descriptor. The indices are one-based. Currently provides no indication if an error occurs.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.removeDescriptorWithKeyword(keyword as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Removes the receiver's descriptor identified by the specified keyword.
Notes:
keyword: A keyword (a four-character code) that identifies the descriptor to remove.

The receiver must be an Apple event or Apple event record. Currently provides no indication if an error occurs.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.removeParamDescriptorWithKeyword(keyword as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Removes the receiver's parameter descriptor identified by the specified keyword.
Notes:
keyword: A keyword (a four-character code) that identifies the parameter descriptor to remove. Currently provides no indication if an error occurs.

The receiver must be an Apple event or Apple event record, both of which can contain parameters.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.send(options as Integer, timeoutInSeconds as Double, byref error as NSErrorMBS) as NSAppleEventDescriptorMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 16.2 Yes No No Yes, macOS only No
Function: Sends an Apple event.
Example:
// pick a file
dim f as FolderItem = SpecialFolder.Desktop.Child("test.rtf")
// make a descriptor for file
dim fd as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithFSRef(f)
// make a descriptor for target app. here by bundle id
dim bd as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithBundleIdentifier("com.apple.finder")
// make a descriptor for apple event, here OpenDocument event
dim ad as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.appleEventWithEventClass("aevt", "odoc", bd, fd.kAutoGenerateReturnID, fd.kAnyTransactionID)

// assign parameter
ad.setParamDescriptor(fd, "----")

// now run
dim e as NSErrorMBS
dim rd as NSAppleEventDescriptorMBS = ad.send(ad.NSAppleEventSendDefaultOptions, 0.1, e)

// error sending?
if e <> nil then
MsgBox e.LocalizedDescription
end if

Break // inspect rd for success or failure of event?

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.setAttributeDescriptor(descriptor as NSAppleEventDescriptorMBS, keyword as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Adds a descriptor to the receiver as an attribute identified by the specified keyword.
Notes:
descriptor: The attribute descriptor to add to the receiver.
keyword: A keyword (a four-character code) that identifies the attribute descriptor to add. If a descriptor with that keyword already exists in the receiver, it is replaced.

The receiver must be an Apple event. Currently provides no indication if an error occurs.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.setDescriptor(descriptor as NSAppleEventDescriptorMBS, keyword as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Adds a descriptor, identified by a keyword, to the receiver.
Notes:
descriptor: The descriptor to add to the receiver.
keyword: A keyword (a four-character code) that identifies the descriptor to add. If a descriptor with that keyword already exists in the receiver, it is replaced.

The receiver must be an Apple event or Apple event record. Currently provides no indication if an error occurs.

Feedback, Comments & Corrections

NSAppleEventDescriptorMBS.setParamDescriptor(descriptor as NSAppleEventDescriptorMBS, keyword as string)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method Apple Script MBS MacCocoa Plugin 11.2 Yes No No Yes, macOS only No
Function: Adds a descriptor to the receiver as an Apple event parameter identified by the specified keyword.
Notes:
descriptor: The parameter descriptor to add to the receiver.
keyword: A keyword (a four-character code) that identifies the parameter descriptor to add. If a descriptor with that keyword already exists in the receiver, it is replaced.

The receiver must be an Apple event or Apple event record, both of which can contain parameters.

Feedback, Comments & Corrections

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




Links
MBS Xojo PDF Plugins