generated from cfillion/reapack-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update and rename smandrap_Insert new subproject in Subproject folder…
….lua to smandrap_Move tracks to subprojects, prompt for name.lua
- Loading branch information
Showing
2 changed files
with
43 additions
and
34 deletions.
There are no files selected for viewing
34 changes: 0 additions & 34 deletions
34
Subprojects/smandrap_Insert new subproject in Subproject folder.lua
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
Subprojects/smandrap_Move tracks to subprojects, prompt for name.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
-- @description Move tracks to subprojects, prompt for name | ||
-- @author smandrap | ||
-- @version 1.0 | ||
-- @noindex | ||
-- @donation https://paypal.me/smandrap | ||
-- @about | ||
-- Does what it says. Requires SWS. | ||
-- @readme_skip | ||
|
||
|
||
PREFIX_PROJECT_NAME = false | ||
USE_SUBFOLDER = false | ||
|
||
local LABEL = 'SubProject' | ||
local SUBFOLDER = 'SubProjects' | ||
|
||
if reaper.CountSelectedTracks(0) == 0 then return end | ||
|
||
local swsok = false | ||
if not reaper.CF_GetSWSVersion then | ||
reaper.MB("This script requires SWS extensions", "SWS REQUIRED", 0) | ||
end | ||
|
||
local function main() | ||
local rec_path = select(2, reaper.GetSetProjectInfo_String(0, 'RECORD_PATH', '', false)) | ||
local _, rec_filename = reaper.get_config_var_string('recfile_wildcards') | ||
|
||
local rv, LABEL = reaper.GetUserInputs('Move items to subproject', 1, 'extrawidth=100,Name:', LABEL) | ||
if rv then | ||
reaper.SNM_SetStringConfigVar('recfile_wildcards', PREFIX_PROJECT_NAME and '$project - 'or ''..LABEL) | ||
|
||
if USE_SUBFOLDER then reaper.GetSetProjectInfo_String(0, 'RECORD_PATH', SUBFOLDER, true) end | ||
reaper.Main_OnCommand(41997, 0) | ||
reaper.GetSetProjectInfo_String(0, 'RECORD_PATH', rec_path, true) | ||
|
||
if swsok then reaper.SNM_SetStringConfigVar('recfile_wildcards', rec_filename) end | ||
end | ||
end | ||
|
||
|
||
reaper.Undo_BeginBlock() | ||
main() | ||
reaper.Undo_EndBlock('Move tracks to subproject, prompt for name', 0) |