Java Script Engine getAppleScriptEngine()

Here you can find the source of getAppleScriptEngine()

Description

Obtiene el motor de script AppleScript.

License

Open Source License

Return

Motor de script AppleScript.

Declaration

public static ScriptEngine getAppleScriptEngine() 

Method Source Code

//package com.java2s;
/* Copyright (C) 2011 [Gobierno de Espana]
 * This file is part of "Cliente @Firma".
 * "Cliente @Firma" is free software; you can redistribute it and/or modify it under the terms of:
 *   - the GNU General Public License as published by the Free Software Foundation;
 *     either version 2 of the License, or (at your option) any later version.
 *   - or The European Software License; either version 1.1 or (at your option) any later version.
 * Date: 11/01/11/*from   ww  w . ja  v  a  2 s. c o  m*/
 * You may contact the copyright holder at: soporte.afirma5@mpt.es
 */

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;

public class Main {
    /** Obtiene el motor de <i>script</i> <code>AppleScript</code>.
     * @return Motor de <i>script</i> <code>AppleScript</code>. */
    public static ScriptEngine getAppleScriptEngine() {

        // Probamos las dos formas de instanciar el motor AppleScript

        // Nuevo nombre desde OS X Yosemite: AppleScriptEngine
        final ScriptEngine se = new ScriptEngineManager()
                .getEngineByName("AppleScriptEngine"); //$NON-NLS-1$
        if (se != null) {
            return se;
        }
        // Nombre en versiones antiguas de OS X
        return new ScriptEngineManager().getEngineByName("AppleScript"); //$NON-NLS-1$
    }
}

Related

  1. compile(ScriptEngine engine, String script)
  2. createNashornEngine()
  3. evaluateScriptResource(ScriptEngine engine, String resource)
  4. getAvailableEngineGroups()
  5. getDefaultScriptEngineManager()
  6. getEngine()
  7. getEngine(String engineName)