Skip to content

Commit

Permalink
Create smandrap_Insert new subproject in Subproject folder.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
smandrap authored Mar 12, 2024
1 parent 0a2c68a commit 32cfc4f
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 label 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', 0)

0 comments on commit 32cfc4f

Please sign in to comment.