void (@NotNull AnActionEvent e) { if (pathToFile() == null) { VirtualFile selectedFile = FileChooser.chooseFile(FILE_DESCRIPTOR, myComponent, getEventProject(e), null); if (selectedFile != null) { myState.currentScript = selectedFile.getPresentableUrl(); myCurrentScript.setText(myState.currentScript); } else { //noinspection DialogTitleCapitalization Messages.showErrorDialog(LangBundle.message("dialog.message.file.to.save.selected"), LangBundle.message("dialog.title.cannot.save.script")); return; } } ApplicationManager.getApplication().runWriteAction(() -> save()); }