Skip to content

Commit b0f1513

Browse files
committed
Some more work
1 parent 865118c commit b0f1513

2 files changed

Lines changed: 172 additions & 0 deletions

File tree

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
--[[
2+
@description Rename markers from QLab Cue IDs to Cue Names
3+
@author Ben Smith
4+
@link
5+
Author https://www.bensmithsound.uk
6+
Repository https://github.com/bsmith96/Reaper-Scripts
7+
@version 1.0
8+
@changelog
9+
+ Initial version
10+
@metapackage
11+
@provides
12+
[main] . > bsmith96_{filename}.lua
13+
@about
14+
# {Package name}
15+
Written by Ben Smith - May 2025
16+
17+
### Info
18+
*
19+
20+
### Usage
21+
*
22+
23+
### User customisation
24+
*
25+
]]
26+
27+
28+
-- =========================================================
29+
-- =============== USER CUSTOMISATION AREA ===============
30+
-- =========================================================
31+
32+
--------- End of user customisation area --
33+
34+
35+
-- =========================================================
36+
-- ================= GLOBAL VARIABLES ====================
37+
-- =========================================================
38+
39+
local r = reaper
40+
41+
-- get the script's name and directory
42+
local scriptName = ({r.get_action_context()})[2]:match("([^/\\_]+)%.lua$")
43+
local scriptDirectory = ({r.get_action_context()})[2]:sub(1, ({r.get_action_context()})[2]:find("\\[^\\]*$"))
44+
local scriptFolder = scriptDirectory:gsub(scriptName..".lua", "")
45+
46+
package.path = scriptFolder .. '?.lua'
47+
48+
-- Require the osc module
49+
local osc = require('osc')
50+
51+
-- =========================================================
52+
-- ====================== FUNCTIONS ======================
53+
-- =========================================================
54+
55+
56+
-- =========================================================
57+
-- ====================== UTILITIES ======================
58+
-- =========================================================
59+
60+
-- Deliver messages and add new line in console
61+
function dbg(dbg)
62+
r.ShowConsoleMsg(tostring(dbg) .. "\n")
63+
end
64+
65+
-- Deliver messages using message box
66+
function msg(msg, title)
67+
local title = title or scriptName
68+
r.MB(tostring(msg), title, 0)
69+
end
70+
71+
72+
-- =========================================================
73+
-- =================== MAIN ROUTINE ======================
74+
-- =========================================================
75+
76+
r.Undo_BeginBlock()
77+
78+
local i=1
79+
80+
local retval, isrgn, pos, rgnend, name, markrgnindexnumber, color = reaper.EnumProjectMarkers3( 0, i )
81+
if not isrgn then
82+
r.GoToMarker(0,i,1)
83+
end
84+
85+
r.Undo_EndBlock(scriptName, -1)
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
--[[
2+
@description
3+
@author Ben Smith
4+
@link
5+
Author https://www.bensmithsound.uk
6+
Repository https://github.com/bsmith96/Reaper-Scripts
7+
@version 1.0
8+
@changelog
9+
+ Initial version
10+
@metapackage
11+
@provides
12+
[main] . > bsmith96_{filename}.lua
13+
@about
14+
# {Package name}
15+
Written by Ben Smith - {Month Year}
16+
17+
### Info
18+
*
19+
20+
### Usage
21+
*
22+
23+
### User customisation
24+
*
25+
]]
26+
27+
28+
-- =========================================================
29+
-- =============== USER CUSTOMISATION AREA ===============
30+
-- =========================================================
31+
32+
--------- End of user customisation area --
33+
34+
35+
-- =========================================================
36+
-- ================= GLOBAL VARIABLES ====================
37+
-- =========================================================
38+
39+
local r = reaper
40+
41+
-- get the script's name and directory
42+
local scriptName = ({r.get_action_context()})[2]:match("([^/\\_]+)%.lua$")
43+
local scriptDirectory = ({r.get_action_context()})[2]:sub(1, ({r.get_action_context()})[2]:find("\\[^\\]*$"))
44+
local scriptFolder = scriptDirectory:gsub(scriptName..".lua", "")
45+
46+
package.path = scriptFolder .. '?.lua'
47+
48+
-- Require the osc module
49+
local osc = require('osc')
50+
51+
-- =========================================================
52+
-- ====================== FUNCTIONS ======================
53+
-- =========================================================
54+
55+
56+
-- =========================================================
57+
-- ====================== UTILITIES ======================
58+
-- =========================================================
59+
60+
-- Deliver messages and add new line in console
61+
function dbg(dbg)
62+
r.ShowConsoleMsg(tostring(dbg) .. "\n")
63+
end
64+
65+
-- Deliver messages using message box
66+
function msg(msg, title)
67+
local title = title or scriptName
68+
r.MB(tostring(msg), title, 0)
69+
end
70+
71+
72+
-- =========================================================
73+
-- =================== MAIN ROUTINE ======================
74+
-- =========================================================
75+
76+
r.Undo_BeginBlock()
77+
78+
-- get OSC message
79+
local msg = osc.get()
80+
81+
82+
local newName = msg.arg
83+
84+
85+
dbg("didn't work")
86+
87+
r.Undo_EndBlock(scriptName, -1)

0 commit comments

Comments
 (0)