How to write and debug scripts in IntelliJ IDEA

IntelliJ IDEA is a powerful commercial tool for development. There is a free common edition version, which you can use for writing scripts.

After building project you can open it in IDE.

  • First of all open "Project Structure" (Ctrl+Shift+S) and choose Project language level: 7.0 and save changes.
  • Open "Maven Projects" tab and click "Reimport All Maven Projects" button

Now you can write your actions in existing files or add new classes for that.

For packaging scripts:

  • Open "Maven Projects" tab
  • Choose "clean", "package" items
  • Click "Run" button

After that, all scripts will be packaged into ts-scripts.jar archive and placed in etc/plugins/scripts folder of your TrackStudio copy.

Debug scripts

  • Go to "Run > Edit Configurations" (Alt + U then R)
  • Click + button and choose "Remote"
  • Copy command line arguments for running remote JVM,

paste it into the end of startJetty.vmoptions and save the file. (TrackStudio should be restarted)

  • Enter name for Debug configuration and save changes.
  • Now you can run debug configuration.