Platforms to show: All Mac Windows Linux Cross-Platform

Back to AppleScriptMBS class.

AppleScriptMBS.AllowInteraction as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Apple Script MBS MacClassic Plugin 17.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Whether to allow user interaction.

Default is false to disallow.
You can set to true to allow GUI.
(Read and Write property)

AppleScriptMBS.CanUnicodeText as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Apple Script MBS MacClassic Plugin 3.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
True if AppleScript can handle Unicode text.
Example
dim a as new AppleScriptMBS

MsgBox str(a.CanUnicodeText)

This property is set to true if AppleScript 1.3 or newer is installed.
(AppleScript 1.3 was introduced around the time of Mac OS 8.6)
(Read only property)

Some examples using this property:

AppleScriptMBS.Handle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Apple Script MBS MacClassic Plugin 3.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The handle of the used AppleScript component.
Example
dim a as new AppleScriptMBS
MsgBox str(a.Handle)

(Read and Write property)

AppleScriptMBS.Lasterror as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Apple Script MBS MacClassic Plugin 3.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The last error code.
Example
dim a as new AppleScriptMBS
MsgBox str(a.Lasterror)

Value is 0 for successfull and -1 if function is not available.
All other values are normal Mac OS error codes.

Some common error codes for this class:
OSASystemError -1750
OSAInvalidID -1751
OSABadStorageType -1752
OSAScriptError -1753
OSABadSelector -1754
OSASourceNotAvailable -1756
OSANoSuchDialect -1757
OSADataFormatObsolete -1758
OSADataFormatTooNew -1759
OSACorruptData -1702
OSARecordingIsAlreadyOn -1732
OSAComponentMismatch -1761Parameters are from 2 different components
OSACantOpenComponent -1762Can't connect to scripting system with that ID
OSACantCoerce -1700Signaled when a value can't be coerced to the desired type.
OSACantAccess -1728Signaled when an object is not found in a container
OSACantAssign -10006Signaled when an object cannot be set in a container.
OSAGeneralError -2700Signaled by user scripts or applications when no actual error code is to be returned.
OSADivideByZero -2701Signaled when there is an attempt to divide by zero
OSANumericOverflow -2702Signaled when integer or real value is too large to be represented
OSACantLaunch -2703Signaled when application can't be launched or when it is remote and program linking is not enabled
OSAAppNotHighLevelEventAware-2704Signaled when an application can't respond to AppleEvents
OSACorruptTerminology -2705Signaled when an application's terminology resource is not readable
OSAStackOverflow -2706Signaled when the runtime stack overflows
OSAInternalTableOverflow -2707Signaled when a runtime internal data structure overflows
OSADataBlockTooLarge -2708Signaled when an intrinsic limitation is exceeded for the size of a value or data structure.
OSACantGetTerminology -2709
OSACantCreate -2710
(Read and Write property)

AppleScriptMBS.ResultID as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Apple Script MBS MacClassic Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The internal result ID for the current script.
Example
dim a as new AppleScriptMBS

a.Compile "return ""hello"""
a.Execute

MsgBox str(a.ResultID)

May be useful for Toolbox calls.
(Read and Write property)

AppleScriptMBS.ScriptID as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Apple Script MBS MacClassic Plugin 9.6 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
The internal script ID for the current script.
Example
dim a as new AppleScriptMBS

a.compile "beep"

MsgBox str(a.ScriptID)

May be useful for Toolbox calls.
(Read and Write property)

AppleScriptMBS.UnicodeText as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Apple Script MBS MacClassic Plugin 3.1 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
True if you want to use unicode.
Example
dim a as AppleScriptMBS

a=new AppleScriptMBS
a.UnicodeText=true

dim s as string="tell application ""iTunes"""+chr(13)+"set rating of (track ""Flintstones áé"") to 40"+chr(13)+"end tell"
a.compile ConvertEncoding(s,Encodings.UTF16)
MsgBox str(a.Lasterror)

a.Execute
MsgBox str(a.Lasterror)

MsgBox a.Result

If this property is true, all functions try to get strings as 16 bit Unicode strings.
Strings you pass which are in 16 bit Unicode are passed in Unicode to AppleScript.
You may get trouble if the strings you give this class are not in the system encoding (MacRoman?) or 16 bit Unicode. UTF8 will not work!
(Read and Write property)

Some examples using this property:

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


The biggest plugin in space...