Plugins written in [Groovy](http://groovy-lang.org/) script for [IntelliJ IDEA](http://jetbrains.com/idea/) based IDE's that can be enhanced through [LivePlugin](https://github.com/dkandalov/live-plugin) plugin connector.
+* [eSpeak Selection](https://osdn.jp/projects/ii-lp-script/scm/git/ii-lp-script/tree/master/eSpeak%20Selection/) -- Reads the current selection aloud.
* [Line Sort](https://osdn.jp/projects/ii-lp-script/scm/git/ii-lp-script/tree/master/Line%20Sort/) -- Sorts the selected lines according to a sorting method.
* [Move Caret to Word End](https://osdn.jp/projects/ii-lp-script/scm/git/ii-lp-script/tree/master/Move%20Caret%20To%20Word%20End/) -- Moves all carets to the closes word end.
* [PrettyPrint](https://osdn.jp/projects/ii-lp-script/scm/git/ii-lp-script/tree/master/PrettyPrint/) -- Formats the current selection as prettified JSON or XML.
--- /dev/null
+// plugin eSpeak Selection
+// version 0.0
+// release April 2016
+// author Plugin Fan
+// license GPL v 3.0
+
+// Reads the current selection aloud:
+// - Alt-E - eSpeak Selection
+//
+// Not really related to the source code, more a helper to understand it.
+
+
+import com.intellij.openapi.actionSystem.AnActionEvent
+import com.intellij.notification.NotificationType
+
+import groovy.json.JsonSlurper
+
+import static liveplugin.PluginUtil.*
+
+// load configuration
+def configName = pluginPath + '/config.json'
+def configFile = new File(configName)
+if (! configFile.exists())
+ return show("Configuration file “${configName}” not found", '', NotificationType.ERROR)
+
+config = new JsonSlurper().parse(configFile.toURL())
+
+// perform the speaking
+def eSpeak(project, voice)
+{
+ runDocumentWriteAction(project) {
+ currentEditorIn(project).with {
+ if (! selectionModel.hasSelection())
+ return
+
+ def espeak = new ProcessBuilder(['espeak', '-v', voice] + config.option).start()
+ def stream = new PrintStream(espeak.outputStream)
+ stream.println(selectionModel.getSelectedText(true))
+ stream.close()
+ }
+ }
+}
+
+registerAction('eSpeak Selection', 'alt E') { AnActionEvent event ->
+ def project = event.project
+
+ if (config.generic.skipMenu)
+ eSpeak(project, config.voice.first())
+ else
+ showPopupMenu(config.voice.collectEntries { voice -> [voice, { eSpeak(project, voice) } ] }, 'eSpeak Voice', event.dataContext)
+}