Platforms to show: All Mac Windows Linux Cross-Platform
/Mac/AppleScript/AppleScript with Unicode
Feedback.
Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /Mac/AppleScript/AppleScript with Unicode
This example is the version from Sun, 17th Nov 2007.
Notes: Last modified: Sun, 17th Nov 2007
Feedback.
Function:
You find this example project in your Plugins Download as a Realbasic project file within the examples folder: /Mac/AppleScript/AppleScript with Unicode
This example is the version from Sun, 17th Nov 2007.
Notes: Last modified: Sun, 17th Nov 2007
Class App
Inherits Application
// Event implementations
Sub Open()
dim a as AppleScriptMBS
dim b as AppleScriptMBS
dim t as TextConverter
dim s as String
a=new AppleScriptMBS
if not a.CanUnicodeText then
MsgBox "We need Apple Script 1.3 or newer for Unicode text handling."
end if
a.UnicodeText=true // use it
// compile this source code
s="display dialog ""Hello World!"""
// MsgBox str(lenb(s)) // 29
t=GetTextConverter(GetTextEncoding(0),GetTextEncoding(256))
s=t.convert(s)
// MsgBox str(lenb(s)) // 58 if it's now unicode (16bit, not UTF8!)
a.Compile s
b=new AppleScriptMBS
// now we copy the binary code to another object
b.Binary=a.Binary
// and run it
b.Execute
// now decompile
s=b.Source
MsgBox str(lenb(s)) // 29 if returned as MacRoman and 58 if returned as Unicode
MsgBox s
Quit
End Sub
End Class
See also:
Links
MBS Realbasic PDF Plugins - Christians Software aus Nickenich