- ReaScript Basics — Interview on REAPER blog / Part-1
- ReaScript Basics — Interview on REAPER blog / Part-2
- How to Learn ReaScript for REAPER
- Useful Tools for REAPER Scripters
- ReaScript: What can we Expect from v5 Pre-Releases?
- Advanced Actions Management: Import and Export Toolbars Buttons linked to Scripts, Change Script Path and Name
- Scripting for REAPER: General Guidelines
- ReaScript Video Tutorial — Part. 1: The Console Output
- ReaScript Video Tutorial — Part. 2: The Api Documentation
- ReaScript Video Tutorial — Part. 3: Get/Set First Selected Item Properties
- ReaScript Video Tutorial — Part. 4: Loop in Selected Items
- ReaScript Video Tutorial — Part. 5: Conditions Basics
- ReaScript Video Tutorial — Part. 6: Time Selection
- ReaScript Video Tutorial — Part. 7: Loop in Items on Selected Tracks
- ReaScript Video Tutorial — Part. 8: Using Native Actions
- ReaScript Video Tutorial — Part. 9: Preventing Bugs
- ReaScripts Templates Repository on GitHub
Facts:
- When importing a script into REAPER, it’s command ID is randomly generated.
- When creating a custom actions, it’s command ID is randomly generated.
- Menu actions are defined by command ID.
- You can’t rename an actions related to a script, or change this script path.
Question: How to share toolbars with a scripts and custom actions on it (without sharing full config) ? You can’t just import the scripts and the menu settings, as the command ID will not match.
Few days ago, my answer to that was simple: “you can’t”. And for toolbars full of scripts, as my Text Item Formatting toolbar, this was a major issue.
We speak about that on the forum, without finding solution, so I wrote a deep feature request, related to that: Better Scripts Management: Importation, Folders, ID, Deletion.
The truth: it is not that we cannot do it. We just didn’t found how !
I was playing with config file (it was fun, trust me) when an idea came to me. And after some tests, I came up with a way to solve that problem !
You already have waiting to much for this, so here is how to do it !
Tutorial
This is a silent video. You can still work on REAPER or listen to the last album of your favorite artist while looking at it !
Here is a recap of the tutorial:
Creation of the ReaperKeyMap
- Put scripts in default user scripts folder (you can have subfolders)
- Open REAPER
- Import scripts via the Actions window
- Export scripts infos (ReaperKeyMap) via Action window
- Edit ReaperKeyMap action COMMAND_ID in a text/code editor (see details on that below)
- Delete keyboards shortcuts infos. It look like this : KEY 1 87 _a07c4dfa374aa74aa7636c3e92e2be85 32060
- Delete obsolete scripts in REAPER (those you just changed the command ID)
- Import scripts via ReaperKeyMap into REAPER with Actions window
- Build the Menu
- Export the Menu
- Share the menu, the scripts, and the ReaperKeyMap
Modifications and Importation
- Put scripts in default user scripts folder
- Open REAPER
- Import scripts (ReaperKeyMap) into REAPER
- Import Menu
The importation workflow with ReaperKeyMap allows you to rename scripts and change their path. I don’t know if the way subfolder path is written is OS-Dependant.
You can modify a ReaperKeyMap in a code editor to change some infos, like Script Command_ID, Script Path and Action name.
Here is what the keymap code looks like:
SCR 4 0 "AUTHOR_ACTION_ID" "Custom: Action name" "Script name.eel"
The first string is COMMAND_ID, the second is action name, and third is path relative to user script default folder.
Speaking about COMMAND_ID, I don’t know yet all we have to know to make a good one, but based on what I was from SWS extensions, I will advice you to keep it concise, without spaces, and write it in UPPERCASE. Of course, it has to be unique, so add your pseudo as prefix may be a way to be sure that your COMMAND_ID will be unique.
- Letters, numbers and underscore (_) only
- Letters Uppercase
- Don’t start with an underscore (_): it will be added automatically
- No more than 34 characters (it seems to work with more but this I cannot be sure)
- Use a distinct initial as prefix (from your pseudo for eg), to be sure that your command IDs will be unique
Command_ID seem to be more flexible than that but I can’t test every possibility (aka call from other scripting language, different OS, toolbars etc…), so keep it simple.
You have more freedom with action name but you have to be careful, for the same reason. There is only one critical rule:
It will be modified into Script: if it is linked to a script.
This leads to another way to import script, useful if you want a action name different from the file name, of if you want to important lots of scripts at the same time, without create duplicate (in case of you already have some of them in your config).
Path (EDIT: 2015-07-15)
The REAPER keymap is different on Windows and on Mac.
If you script is in a subfolder, the path will loke like this when exported from Windows :
SCR 4 0 "AUTHOR_ACTION_ID" "Custom: Action name" "Folder\Script name.eel"
Mac version would be like this :
SCR 4 0 "AUTHOR_ACTION_ID" "Custom: Action name" "Folder/Script name.eel"
If you want to share your Actions list, you may need to create a WIn and a Mac version of the reaper keymap, and search/replace all the slashes/anti-slashes accordingly.
Conclusion
Thanks to this methods, we will be able to share toolbars full of scripts.
It may be the perfect time to write my next-gen subtitling with REAPER tutorial ! 😀
- ReaScript Basics — Interview on REAPER blog / Part-1
- ReaScript Basics — Interview on REAPER blog / Part-2
- How to Learn ReaScript for REAPER
- Useful Tools for REAPER Scripters
- ReaScript: What can we Expect from v5 Pre-Releases?
- Advanced Actions Management: Import and Export Toolbars Buttons linked to Scripts, Change Script Path and Name
- Scripting for REAPER: General Guidelines
- ReaScript Video Tutorial — Part. 1: The Console Output
- ReaScript Video Tutorial — Part. 2: The Api Documentation
- ReaScript Video Tutorial — Part. 3: Get/Set First Selected Item Properties
- ReaScript Video Tutorial — Part. 4: Loop in Selected Items
- ReaScript Video Tutorial — Part. 5: Conditions Basics
- ReaScript Video Tutorial — Part. 6: Time Selection
- ReaScript Video Tutorial — Part. 7: Loop in Items on Selected Tracks
- ReaScript Video Tutorial — Part. 8: Using Native Actions
- ReaScript Video Tutorial — Part. 9: Preventing Bugs
- ReaScripts Templates Repository on GitHub