Use with JMRI

If you use JMRI (version 4.5.2 or newer) on macOS and wish to use AppleScript to automate activities in JMRI, you can install support either automatically or manually.

Automatic Installation

  1. Enter the following command in a Terminal.app window and press the Enter key:

    bash <( curl -sSL https://jmri.github.io/applescript/install.sh )
    
  2. Start DecoderPro or PanelPro. Verify installation was successful by selecting the menu item Actions->Run Script… (in DecoderPro) or Panels->Run Script… (in PanelPro) and seeing that AppleScript Files is an option in the File Format pop-up menu.

Manual Installation

  1. Download the version 1.0 of JMRI AppleScript Support to the Downloads folder

  2. Open Terminal.app and enter the following commands, pressing the Enter key after each command (these commands assume JMRI is installed in /Applications/JMRI):

    mkdir -p ~/Library/Application\ Support/JMRI/lib
    mv ~/Downloads/applescript-1.0.jar ~/Library/Application\ Support/JMRI/lib
    cp -n /Applications/JMRI/jmri.conf ~/Library/Preferences/JMRI/jmri.conf
    open -e ~/Library/Preferences/JMRI/jmri.conf
    
  3. Edit jmri.conf to change the line default_options="" to read:

    default_options="--cp:a=${HOME}/Library/Application\ Support/JMRI/lib/applescript-1.0.jar"
    

    If default_options already contains other text, you can add --cp:a=${HOME}/Library/Application\ Support/JMRI/lib/applescript-1.0.jar to the existing default_options just before the closing quotation mark (ensure a space separates this option from the preceding option).

  4. Save jmri.conf.

  5. Start DecoderPro or PanelPro. Verify installation was successful by selecting the menu item Actions->Run Script… (in DecoderPro) or Panels->Run Script… (in PanelPro) and seeing that AppleScript Files is an option in the File Format pop-up menu.