Xojo Conferences

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCocoa/AppleScript/NSAppleScriptMBS with properties
Required plugins for this example: MBS MacBase Plugin, MBS MacCocoa 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 with properties
This example is the version from Mon, 16th Jul 2017.
Project "NSAppleScriptMBS with properties.rbp"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
EventHandler Sub Open() dim s as String dim a as NSAppleScriptMBS s=s+"property hello : ""Hallo Leute"""+chr(13) s=s+"property just : ""Just a test"""+chr(13) s=s+"display dialog hello"+chr(13) s=s+"return just"+chr(13) 'MsgBox "The script:"+chr(13)+s a=new NSAppleScriptMBS(s) // compile call a.Compile // show names dim names() as string = a.properties MsgBox Join(names,EndOfLine) // query value MsgBox a.valueDescriptorForProperty("hello").stringValue // change value dim o as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithString("just a test") call a.setValueDescriptorForProperty("hello", o) // and query again MsgBox a.valueDescriptorForProperty("hello").stringValue quit End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project

See also:

Feedback, Comments & Corrections

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

MBS Xojo blog