Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSAppleScriptMBS class.
NSAppleScriptMBS.Handle as Integer
Function:
The internal reference to the NSAppleScript object.
Notes: (Read and Write property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Apple Script | MBS MacCocoa Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Notes: (Read and Write property)
NSAppleScriptMBS.isCompiled as boolean
Function:
Returns a Boolean value that indicates whether the receiver's script has been compiled.
Example:
Notes:
(Read only property)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Apple Script | MBS MacCocoa Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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)
NSAppleScriptMBS.richTextSource as NSAttributedStringMBS
Function:
Returns the syntax-highlighted source code of the receiver if the receiver has been compiled and its source code is available.
Example:
Notes:
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Apple Script | MBS MacCocoa Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
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
Function:
Returns the script source for the receiver.
Notes:
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)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Apple Script | MBS MacCocoa Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Notes:
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.
