Track naming using Applescript

Hi!

For the ones who don’t know, I’ve become kind of an expert in counting how many times my neighbours are exeeding the 10 dB noise limit with their thumps (in their floor, my ceilling). I might write an article describing all the steps so that others can also write detailed reports for the police. But for now, let me just show off a bit.
:grin:

Screen recording showing how easily tracks can be renamed in Cubase using Applescript

Script
set delo to 0.4
set daysInMonth to {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
set monthNames to {"ian", "feb", "mar", "apr", "mai", "iun", "iul", "aug", "sep", "oct", "noi", "dec"}

--firstDay
display dialog "Type day number" default answer "" buttons {"OK", "Abort"} default button 1
copy the result as list to {button_pressed, text_returned}
set firstDay to item 2 of result
if button_pressed is "Abort" then
	return
end if

--firstMonth
display dialog "Type month number" default answer "" buttons {"OK", "Abort"} default button 1
copy the result as list to {button_pressed, text_returned}
set firstMonth to item 2 of result
if button_pressed is "Abort" then
	return
end if

--firstYear
display dialog "Type year number" default answer "2024" buttons {"OK", "Abort"} default button 1
copy the result as list to {button_pressed, text_returned}
set firstYear to item 2 of result
if button_pressed is "Abort" then
	return
end if

set vday to firstDay
set vmonth to firstMonth
set vyear to firstYear

set monthName to item vmonth of monthNames

tell application "Cubase 12" to activate
delay 1

-- double click at pointer current position
do shell script "eval $(/usr/libexec/path_helper -s);  cliclick dc:."

repeat 5 times
	tell application "System Events"
		delay delo
		keystroke "" & vday & " " & monthName & " " & "(08.00) - " & vday & " " & monthName & " " & "(13.00) __ "
		delay delo
		key code 48
		delay delo
		keystroke "" & vday & " " & monthName & " " & "(13.00) - " & vday & " " & monthName & " " & "(14.00) __ "
		delay delo
		key code 48
		delay delo
		keystroke "" & vday & " " & monthName & " " & "(14.00) - " & vday & " " & monthName & " " & "(22.00) __ "
		delay delo
		key code 48
	end tell
	
	set oday to vday
	set omonthName to monthName
	
	-- Adjust the day
	set vday to vday + 1
	
	if vday > 1 then
		set tempday to vday - 1
	else
		set tempday to oday
	end if
	
	-- Check if we've exceeded the number of days in the month
	if vday > item vmonth of daysInMonth then
		set vday to 1
		set vmonth to vmonth + 1
		
		-- Check if we've exceeded the number of months in the year
		if vmonth > 12 then
			set vmonth to 1
			set vyear to vyear + 1
		end if
	end if
	
	set monthName to item vmonth of monthNames
	
	tell application "System Events"
		delay delo
		keystroke "" & tempday & " " & omonthName & " " & "(22.00) - " & vday & " " & monthName & " " & "(08.00) __ "
		delay delo
		key code 48
	end tell
end repeat

P.S. I’m happy to answer any question anyone might have.