|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.mucommander.ui.macosx.AppleScript
public class AppleScript
This class allows to run AppleScript code under Mac OS X, relying on the osacript command available
that comes with any install of Mac OS X. This command is used instead of the Cocoa-Java library which has been
deprecated by Apple.
Calls to execute(String, StringBuffer) on any OS other than Mac OS X will always fail.
Important notes about character encoding:
| Field Summary | |
|---|---|
static java.lang.String |
MACROMAN
The MacRoman encoding |
static java.lang.String |
UTF8
The UTF-8 encoding |
| Constructor Summary | |
|---|---|
AppleScript()
|
|
| Method Summary | |
|---|---|
static boolean |
execute(java.lang.String appleScript,
java.lang.StringBuffer outputBuffer)
Executes the given AppleScript and returns true if it completed its execution normally, i.e. |
static java.lang.String |
getScriptEncoding()
Returns the encoding that AppleScript uses on the current runtime environment: UTF8 for AppleScript 2.0+ (Mac OS X 10.5 and up)
MACROMAN for AppleScript 1.10- (Mac OS X 10.4 or lower)
If MACROMAN is used, the scripts passed to execute(String, StringBuffer) should not contain
characters that are not part of the MacRoman charset or they will not be properly interpreted. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String UTF8
public static final java.lang.String MACROMAN
| Constructor Detail |
|---|
public AppleScript()
| Method Detail |
|---|
public static boolean execute(java.lang.String appleScript,
java.lang.StringBuffer outputBuffer)
true if it completed its execution normally, i.e. without
any error.
The script's output is accumulated in the given StringBuffer. If the script completed its execution
normally, the buffer will contain the script's standard output. If the script failed because of an error in it,
the buffer will contain details about the error.
If the caller is not interested in the script's output, a null value can be passed which will
speed the execution up a little.
appleScript - the AppleScript to executeoutputBuffer - the StringBuffer that will hold the script's output, null for no output
public static java.lang.String getScriptEncoding()
UTF8 for AppleScript 2.0+ (Mac OS X 10.5 and up)MACROMAN for AppleScript 1.10- (Mac OS X 10.4 or lower)MACROMAN is used, the scripts passed to execute(String, StringBuffer) should not contain
characters that are not part of the MacRoman charset or they will not be properly interpreted.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This file is part of muCommander - Copyright (C) 2002-2008 Maxence Bernard