Skip to content
Christian Fillion edited this page Apr 29, 2024 · 71 revisions
  1. Package Types
    1. ReaScript
    2. JS Effect
    3. Extension
    4. Theme
    5. Language Pack
    6. Web Interface
    7. Misc. Data
  2. Snippets
    1. Bundle additional files
    2. Multiple user-callable scripts
    3. Hide from the action list
    4. Download from internet
    5. Rename a file
    6. Multiple slots

Package Types

ReaScript

(Note that only @version is required)

-- @description Display name/short description
-- @version 1.0.1
-- @author John Doe
-- @about
--   # Your Package's Title
--   Longer description/documentation for this package in *markdown*.
-- @changelog
--   Changed the button label to just "OK"
--   Fixed a typo in the popup dialog's text

reaper.ShowMessageBox("Hello World", "Script code here", 0)

JS Effect

Utility/Effect Name.jsfx

version: 1.0.5
desc: Display name/short description
author: John Doe
about:
  # Your Package Title
  Longer description and documentation for this package in *markdown*.
changelog:
  - Added super cool feature XYZ
  - Removed unused triggers

@init

@slider

@block

@sample

Extension

Extensions/Brain Interface.ext

@description Display name/short description
@version 1.0.5
@author John Doe
@about
  # Your Package Title
  Longer description/documentation for this package in *markdown*.
@changelog
  - Added super cool feature XYZ
  - Removed unused triggers
@provides
   [darwin] reaper_braininterface.dylib http://example.com/download/$version/$path
   [windows] reaper_braininterface.dll http://example.com/download/$version/$path

Theme

Category/author_Theme Name.theme

@description Theme Name
@version 1.0
@provides ThemeFile.ReaperThemeZip http://stash.reaper.fm/12345/$path
@author John Doe
@links
  Forum Thread http://forum.cockos.com/showthread.php?t=175565
@screenshots
  Arrange Window https://i.imgur.com/niDeNll.png
  MIDI Editor https://i.imgur.com/cixprJ7.png
@about
  Optionally write a description of your theme or some documentation here.

Language Pack

Translations/Klingon.ReaperLangPack

#NAME: LangPack Name
;Version: 1.0.1
;Author: John Doe
;Changelog: Fixed a typo
;About: Optionally write some text here (or remove this line)

[common]
DCEF2B4D03DE723C=Name

Web Interface

Web Interfaces/My Interface.www

@description Web Browser Interface Name
@author YourName
@version 1.0
@screenshot https://i.imgur.com/8NOddMK.png
@about Optionally write some text here (or remove this line)
@provides
  my_interface/index.html
  my_interface/*.{css,js,png}

Misc. Data

Utility/Chord Names.data

@description Display name/short description
@version 1.0.5
@author John Doe
@provides Some Directory/*.txt

Snippets

Bundle additional files

Add @noindex or NoIndex: true at the top of Library_File.lua and User_Callable_File.lua to prevent them from being also indexed.

-- @version 1.0
-- @provides
--   Library_File.lua
--   A Sub Directory/*.png
--   [main] User_Callable_File.lua

reaper.ShowMessageBox("Hello World", "Script code here", 0)

Multiple user-callable scripts

This will create a package containing two files without including itself (because of @metapackage). Notice the lua comment syntax (--) is not required in this case.

@description Name of the package
@version 1.0
@metapackage
@provides
  [main] User Callable File1.lua
  [main] User Callable File2.lua

Hide from the action list

The dot means "current file".

-- @description Name of the package
-- @version 1.0
-- @provides [nomain] .

function LibraryFunction()
end

Download from internet

@description Name of the package
@version 1.0
@provides . http://host.com/download/url/for/file1
@provides logo.png http://host.com/download/url/for/file2

Rename a file

This will install "Original.lua" in the repository as "Target/Name.lua".

-- @description Name of the package
-- @version 1.0
-- @provides Original.lua > Target/Name.lua

Multiple Slots

This will install the current file under multiple different filenames at once. get_action_context is used to get the current filename and extract the slot number. The @metapackage prevents the current file from being installed as-is so that only those created in the @provides tag are.

See also Rename a file.

-- @version 1.0
-- @description Some nice script (3 slots)
-- @metapackage
-- @provides
--   [main] . > myname_Some nice script (slot 1).lua
--   [main] . > myname_Some nice script (slot 2).lua
--   [main] . > myname_Some nice script (slot 3).lua

local script_name = select(2, reaper.get_action_context()):match('([^/\\_]+)%.lua$')
local slot = tonumber(script_name:match('slot (%d+)'))

reaper.Undo_BeginBlock()
-- code here, using `slot` to determine what to do
reaper.Undo_EndBlock(script_name, 1)