Script Monkey
for IntelliJ IDEA

11 955

Script Monkey breaks the boundaries of Java and helps Java achieve the power & flexibilities of interpreted/dynamic languages. In other words, it helps Java achieve the best of both worlds.

Thanks to the embedded Rhino & Scripting API for being part of Java since v1.6. It's an all-in-one plugin which means, anything that was possible only by writing a plugin can be done using plugin-scripts(simple javascript code). And, any tasks that makes more sense to be scripted can be implemented using this tool.

Instead of explaining what this plugin can do in words, we wanted to show some in action.

  1. Say 'Hello' to Rhino
  2. Let's do some command shell scripting
  3. Timebar plugin script

Getting Started

For the latest information & documentations, please visit the project's homepage

Download plugin

Recent change notes

    Version 1.2.8 changes:
  • Fix missing scripts jar for component initialization of the scripts directory under build 142.x of IDEs.
  • Change script panels now re-use command processor between runs and enable the interactive prompt so that globals can be examined after script is evaluated to ease debugging.
  • Change result printing in interactive shell to do some formatting based on result type and also print null for commands that return null and are not all white space.
    Version 1.2.7 changes:
  • Fix EditorImpl not released, again. Finally figured out that it was the Script panels that were causing this.
  • Change code to modify classloader to find nashorn.jar to the same one used in vsch/idea-multimarkdown plugin.
  • Change ant build of source zip to put the zip under project root instead of under src so it does not complain about including itself.
    Version 1.2.6 changes:
  • Fix scripts were not stoppable via stop action. Now an attempt is made to interrupt a thread and if it does not respond within 2 seconds, then the thread is stopped. Works in all but one case which is unstoppable.
  • Add stop script action button to JS Shell pane so that accidental infinite loops could be terminated instead of hanging the shell.
  • Change JS Shell pane now flushes accumulated text from a running script every 100ms instead of waiting for it to terminate.
    Version 1.2.5 changes:
  • Fix editor was not released error, really fixed it this time.
    Version 1.2.4 changes:
  • Fix editor was not released error.
    Version 1.2.3 changes:
  • Change move global var definition in engine init to address issue #8.
    Version 1.2.2 changes:
  • Add catch assertion errors when executing commands in the shell, otherwise they abort the shell processor.
  • Add text printed to the shell pane converts \r\n and \r to \n to avoid assert fail in document insert.
  • Change timebar.js to nashorn recommended Java.type() usage and use function(){} to SAM conversion.
  • Change remove loading of nashorn:mozilla_compat.js because it screws up exception reporting in eval.
    Version 1.2.1 changes:
  • Fixed with() was hiding all engine scope bindings, now using global scope instead. The way engines are created global scopes are not shared anyway.
  • Fixed text printed through window.println via timer would be interpreted as user typed command
  • Change timebar.js to be reloadable without adding new labels
    Version 1.2.0 changes:
  • Fixed timebar.js to work with nashorn script engine.
  • Changed since build to 141 since it cannot find script engine even if running IDEA jre 1.8
  • Changed toolwindow pane to standard editor with JS highlighting. This is WIP, needs better handling of editing and executing prior command lines.
  • Add Set script file name so that exceptions report the right source
  • Add line and column offsets to exceptions reported for the Script Monkey JS Shell
    Version 1.1.1 changes:
  • Compatible with IntelliJ v14 and v15 EAP ommunity Edition & WebStorm
    Version 1.0.2 changes:
  • Compatible with IntelliJ v12 Community Edition & WebStorm
Awesome capabilities. I love it.
Any chance of updating for current version of IntelliJ (14)?
ScriptMonkey plugin v1.0.2 is working fine in IntelliJ Community Edition, Ultimate Edition & WebStorm v12
FYI Doesn't seem to be compatible with IDEA 12 (default JRE is 7.0). Get this event error messages on startup: 14:05:26 ExceptionInInitializerError: Name:Script Monkey,Version:0.7,Vendor:Siddique Hameed 14:06:24 PluginException: cannot create class "com.boxysystems.scriptmonkey.intellij.action.ShowScriptMonkeyConfigurationAction" [Plugin: Script Monkey]: cannot create class "com.boxysystems.scriptmonkey.intellij.action.ShowScriptMonkeyConfigurationAction" [Plugin: Script Monkey]
I am looking at the latest release (Build#IU-95.24 built on April 2, 2010) in Window XP and the plugin works just fine.
Maia 94.585 doesn't seem to like it. On startup an "Bad Version Number" exception occurs.
Just Great!
Thanks for your feedback. I have added that in the project's homepage.

It will be available in the future release.
Greate plugin! Thanks a lot for it.

But I can't find one feature, that would be very usefull (at least, for me:)) - I would like to be able to assign hot keys to some of my scripts, to call them not during some system event (like project opening or closing), but when I need it.
Thanks for the feedback :)
Congratulations for a polished plugin that's very easy to use!

I look forward to being able to write IDEA plugins in JRuby and Scala. Keep up the good work!
Just an update...
This plugin would also support other scripting languages like Python, Ruby etc. in the future release.
i like the it.

will it support other scripting languages besides javascript?
Please  sign in  to leave a comment.