public String saveAsFile(boolean accessingAsFile) throws IOException { File file = new SikuliIDEFileChooser(SikuliIDE.getInstance(), accessingAsFile).save(); if (file == null) { return null; } String bundlePath = FileManager.slashify(file.getAbsolutePath(), false); if (!file.getAbsolutePath().endsWith(".sikuli")) { bundlePath += ".sikuli"; } if (FileManager.exists(bundlePath)) { int res = JOptionPane.showConfirmDialog( null, SikuliIDEI18N._I("msgFileExists", bundlePath), SikuliIDEI18N._I("dlgFileExists"), JOptionPane.YES_NO_OPTION); if (res != JOptionPane.YES_OPTION) { return null; } } else { FileManager.mkdir(bundlePath); } try { saveAsBundle(bundlePath, (SikuliIDE.getInstance().getCurrentFileTabTitle())); if (Settings.isMac()) { if (!Settings.handlesMacBundles) { makeBundle(bundlePath, accessingAsFile); } } } catch (IOException iOException) { } return getCurrentShortFilename(); }