Platforms to show: All Mac Windows Linux Cross-Platform

/MacCocoa/AppleScript/NSAppleScriptMBS query Mail mailboxes


Required plugins for this example: MBS MacCocoa Plugin, MBS MacBase Plugin, MBS Main Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCocoa/AppleScript/NSAppleScriptMBS query Mail mailboxes

This example is the version from Wed, 27th Oct 2020.

Project "NSAppleScriptMBS query Mail mailboxes.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open() if not TargetMachO then MsgBox "This example is only for Mac." end if End EventHandler
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
End Control
EventHandler Sub Open() dim source as string = "tell application ""Mail"""+EndOfLine.Macintosh+"return mailboxes"+EndOfLine.Macintosh+"end tell" dim n as new NSAppleScriptMBS(source) dim d as Dictionary dim result as NSAppleEventDescriptorMBS = n.execute(d) if d<>nil then MsgBox d.Value(NSAppleScriptMBS.NSAppleScriptErrorMessage) else 'MsgBox result.description dim count as integer = result.numberOfItems dim names() as string for i as integer = 1 to count dim item as NSAppleEventDescriptorMBS = result.descriptorAtIndex(i) dim value as NSAppleEventDescriptorMBS = item.descriptorForKeyword("seld") list.addrow value.stringValue next end if End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
ExternalFile info
End ExternalFile
End Project

See also:

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


The biggest plugin in space...