@Override
    public void run() throws Exception {
        File file = askFile("Please specify a file to import", "Import");

        Program program = importFile(file);
        if (program == null) {
            Language language = getDefaultLanguage(Processor.findOrPossiblyCreateProcessor("x86"));
            if (language == null) {
                println("Unable to locate default language for "+Processor.findOrPossiblyCreateProcessor("x86"));
                return;
            }
            CompilerSpec compilerSpec = language.getDefaultCompilerSpec();
            program = importFileAsBinary(file, language, compilerSpec);
        }
        if (program == null) {
            println("Unable to import program from file "+file.getName());
            return;
        }
        openProgram(program);
    }
@see ghidra.app.script.GhidraScript#run()
Ghidra/Features/Base/ghidra_scripts/ImportProgramScript.java