You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCloud/Sandbox Safe LoginItems Helper App/Main
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control CheckBox1 Inherits CheckBox
ControlInstance CheckBox1 Inherits CheckBox
End Control
Control PushButton2 Inherits PushButton
ControlInstance PushButton2 Inherits PushButton
EventHandler Sub Action()
dim b as Boolean = CheckBox2.Value
if ServiceManagementModuleMBS.LoginItemSetEnabled("de.mbsplugins.demo.helper", b) then
MsgBox "OK"
else
MsgBox "Failed."
end if
End EventHandler
End Control
Control CheckBox2 Inherits CheckBox
ControlInstance CheckBox2 Inherits CheckBox
End Control
Control PushButton3 Inherits PushButton
ControlInstance PushButton3 Inherits PushButton
EventHandler Sub Action()
dim b as Boolean = CheckBox1.Value
if ServiceManagementModuleMBS.RegisterHelperApp("Helper.app", b) then
MsgBox "OK"
else
MsgBox "Failed."
end if
End EventHandler
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
if ServiceManagementModuleMBS.LoginItemRunning("de.mbsplugins.demo.helper") then
MsgBox "Running"
else
MsgBox "Not running."
end if
End EventHandler
End Control
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