Platforms to show: All Mac Windows Linux Cross-Platform
/MacClassic/AppleScript/AppleScript Editor
Required plugins for this example: MBS MacClassic Plugin
Last modified Sun, 5th Nov 2022.
You find this example project in your MBS Xojo Plugin download as a Xojo project file within the examples folder: /MacClassic/AppleScript/AppleScript Editor
Download this example: AppleScript Editor.zip
Project "AppleScript Editor.xojo_binary_project"
Class Window1 Inherits Window
Control EditField1 Inherits TextArea
ControlInstance EditField1 Inherits TextArea
End Control
Control PushButton1 Inherits PushButton
ControlInstance PushButton1 Inherits PushButton
EventHandler Sub Action()
format
End EventHandler
End Control
Sub format()
dim a as AppleScriptMBS
dim s,t as string
a=new AppleScriptMBS
a.Compile EditField1.text
if a.Lasterror=0 then
t=a.Source
s=a.SourceTextStyle
If s<>"" And t<>"" Then
#If RBVersion < 2020 Then
EditField1.SetTextAndStyle t,s
#Else
EditField1.Text = t
#endif
else
MsgBox "Decompile error."
end if
else
MsgBox "Compile error."
end if
End Sub
End Class
MenuBar Menu
MenuItem UntitledMenu3 = ""
MenuItem UntitledMenu2 = "File"
MenuItem FileQuit = "Quit"
MenuItem UntitledMenu7 = ""
MenuItem UntitledMenu0 = "Edit"
MenuItem EditUndo = "Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cut"
MenuItem EditCopy = "Copy"
MenuItem EditPaste = "Paste"
MenuItem EditClear = "Clear"
MenuItem UntitledMenu6 = ""
MenuItem UntitledMenu5 = ""
MenuItem UntitledMenu4 = ""
End MenuBar
Class App Inherits Application
End Class
ExternalFile info
End ExternalFile
End Project
See also:
- /MacClassic/AppleScript/AppleScript
- /MacClassic/AppleScript/AppleScript Root Shell
- /MacClassic/AppleScript/AppleScript Unicode
- /MacClassic/AppleScript/AppleScript with Parameter
- /MacClassic/AppleScript/AppleScript with Periodic Event
- /MacClassic/AppleScript/AppleScript with Unicode
Download this example: AppleScript Editor.zip
The items on this page are in the following plugins: MBS MacClassic Plugin.