Thread: Project Manager
View Single Post
Old 03-30-2020, 05:07 PM   #29
nofish
Human being with feelings
 
nofish's Avatar
 
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,096
Default

Can't test currently but I think something like this should work:

Code:
function restore_proj_started() 
  local ret, proj_started = reaper.GetProjExtState(0, "ARC_COUNTER_TIMER_IN_PROJ_WIN", "PROJECT_STARTED")
  return proj_started
end

proj_started = restore_proj_started()
if proj_started ~= "" then -- if not empty string
  -- only store date, discard the rest
  proj_started = string.sub(proj_started, 1, 10)) 
end
That would only work if the date substring is always in the form DD.MM.YYYY, otherwise a string match function should be used I think but that's not my field.

Last edited by nofish; 03-30-2020 at 05:14 PM.
nofish is offline   Reply With Quote