Configuring Scripts As Standalone Plugins

Starting with RGP Lua version 0.61, it is possible to configure one or more scripts as standalone plugins, appearing to be independent from RGP Lua. It is also possible to suppress RGP Lua’s configuration dialog box, which is the recommended option when running in this mode.

Standalone mode requires

  • A custom configuration file com.robertgpatterson.RGPPluginSettings.xml.
  • Your stand-alone plugin script(s) plus any supporting files.
  • A separate folder in Finale’s Plug-ins folder containing a copy of the RGP Lua plugin, the custom configuration file, and (recommended) your script(s).

RGP Lua searches the folder where it is running and uses a configuration file there if it finds one. If not, it searches the user’s preferences folder and creates a new one there if it isn’t found.

Here is a simple example of a configuration file that installs a script called myplugin.lua. It could be installed in a subfolder “My Plugin” of Finale’s Plug-ins folder, and Finale would place it in a submenu of the same name.

<RGPPluginSettings>
    <RGPLua IncludeUI="false">
        <Scripts>
            <Script Path="myplugin.lua" IsDirectory="false" Debug="false" UseString="false" FromRGPLuaDirectory="true"/>
        </Scripts>
    </RGPLua>
</RGPPluginSettings>

The file can have multiple Script elements. These can be directories (IsDirectory="true") or individual files. The scripts do not have to reside in the same directory with RGP Lua and your custom configuration file, but it makes for a clean installation if they do. (See below.)

Everything about your custom configuration is separate from the main configuration. If you want a System Prefix for your custom configuration, it must be included in the custom configuration file. The scripts can overlap with scripts configured in the main configuration, but they run independently.

A simple way to create this file is to configure the main instance of RGP Lua the way you want it for your standalone installation and then fish that file out of your preferences folder. The location of the preferences folder is

macOS

~/Library/Preferences

Windows

C:Users<user>AppDataRoaming

Of particular interest are the following attributes. Neither can be modified by the RGP Lua plugin itself. You must edit them in a text editor.

IncludeUI (RGPLua tag)

A setting of false suppresses the menu option to open RGP Lua’s configuration dialog. RGP Lua ignores the attribute if it reads its configuration from the default location in the user’s preferences folder.

FromRGPLuaDirectory (Script tag)

A setting of true causes RGP Lua to prepend its running folder to the file path specified by the Path tag. It allows you to create a stand-alone configuration that is not dependent on any particular user’s setup. If any Script element sets this value to true, it is advisable also to set IncludeUI to false.

To keep the user experience as simple as possible, it is strongly recommended to suppress RGP Lua’s configuration option for these kinds of installations. The goal should be that users only see configuration options for instances of the plugin that they have installed themselves.