local pauser = reaper.GetToggleCommandStateEx(0, 40253)
local stoper = reaper.GetToggleCommandStateEx(0, 1016)
local player = reaper.GetToggleCommandStateEx(0, 40076)
local recording = reaper.GetToggleCommandStateEx(0, 40252)

local timer = 0.5 -- Time in seconds
if recording == 1 then 
    reaper.osara_outputMessage("RecordingMode is Normal" )
elseif player ==1 then
    reaper.osara_outputMessage("RecordingMode is time selection auto-punch")
elseif pauser == 1 then
    reaper.osara_outputMessage("RecordingMode is selected item auto-punch")
end
