Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSAppleScriptMBS class.

NSAppleScriptMBS.Handle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The internal reference to the NSAppleScript object.

(Read and Write property)

NSAppleScriptMBS.isCompiled as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns a Boolean value that indicates whether the receiver's script has been compiled.
Example
dim source as string = "tell Application ""iTunes"" to play"
dim n as new NSAppleScriptMBS(source)

MsgBox "isCompiled: "+str(n.isCompiled)

call n.compile

MsgBox "isCompiled: "+str(n.isCompiled)

(Read only property)

NSAppleScriptMBS.richTextSource as NSAttributedStringMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the syntax-highlighted source code of the receiver if the receiver has been compiled and its source code is available.
Example
// init with some source
dim source as string = "tell Application ""iTunes"" to play"
dim n as new NSAppleScriptMBS(source)

// compile
call n.compile

// format text
dim richtext as NSAttributedStringMBS = n.richTextSource

if richtext = nil then
MsgBox "Failed to format source."
else
// write to RTF file
dim file as FolderItem = SpecialFolder.Desktop.Child("test.rtf")
dim b as BinaryStream = file.CreateBinaryFile("")

b.Write richtext.RTF
b.close

file.Launch
end if

Returns nil otherwise. It is possible for an instance of NSAppleScript that has been instantiated with Construtor to be a script for which the source code is not available, but is nonetheless executable.
(Read only property)

NSAppleScriptMBS.source as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Apple Script MBS MacCocoa Plugin 11.2 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the script source for the receiver.

Returns the script source code of the receiver if it is available, "" otherwise.

It is possible for an NSAppleScript that has been instantiated with Constructor to be a script for which the source code is not available but is nonetheless executable.
(Read only property)

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


The biggest plugin in space...