Skip to content

Commit

Permalink
Create Insert new subproject in Subproject folder (prompt for name)
Browse files Browse the repository at this point in the history
  • Loading branch information
smandrap authored Mar 12, 2024
1 parent 47019c5 commit e565b72
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- @description Insert new subproject in Subproject folder (prompt for name)
-- @author smandrap
-- @version 1.0
-- @noindex
-- @donation https://paypal.me/smandrap
-- @about
-- Does What it says. If sws is installed, prefix name with "Subproject"
-- @readme_skip


local LABEL = 'SubProject'
local SUBFOLDER = 'SubProjects'


local swsok = false
if reaper.CF_GetSWSVersion then swsok = true 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')

if swsok then reaper.SNM_SetStringConfigVar('recfile_wildcards', '$project - '..LABEL) end

reaper.GetSetProjectInfo_String(0, 'RECORD_PATH', SUBFOLDER, true)
reaper.Main_OnCommand(41049, 0) -- Insert Subproject
reaper.GetSetProjectInfo_String(0, 'RECORD_PATH', rec_path, true)

if swsok then reaper.SNM_SetStringConfigVar('recfile_wildcards', rec_filename) end
end


reaper.Undo_BeginBlock()
main()
reaper.Undo_EndBlock('Insert SubProject in Subprojects folder', 0)

0 comments on commit e565b72

Please sign in to comment.