From 2389f37ed60ce74eb2dc01330bc8d8e24aa028b5 Mon Sep 17 00:00:00 2001 From: WarmUpTill <19472752+WarmUpTill@users.noreply.github.com> Date: Thu, 11 Dec 2025 17:22:37 +0100 Subject: [PATCH] Add temp var for last recording save path --- data/locale/en-US.ini | 2 ++ plugins/base/macro-condition-recording.cpp | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index 8d346de9..61482c7a 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -2186,6 +2186,8 @@ AdvSceneSwitcher.tempVar.run.process.none.description="When not waiting for the AdvSceneSwitcher.tempVar.recording.durationSeconds="Recording duration" AdvSceneSwitcher.tempVar.recording.durationSeconds.description="Recording duration in seconds.\nThis value does not change while the recording is paused and will be reset to zero if the recording is stopped." +AdvSceneSwitcher.tempVar.recording.lastSavePath="Last save path" +AdvSceneSwitcher.tempVar.recording.lastSavePath.description="The file path of the last saved recording." AdvSceneSwitcher.tempVar.video.patternCount="Pattern count" AdvSceneSwitcher.tempVar.video.patternCount.description="The number of times the given pattern has been found in a given video input frame." diff --git a/plugins/base/macro-condition-recording.cpp b/plugins/base/macro-condition-recording.cpp index 95dfe664..d1a6eac8 100644 --- a/plugins/base/macro-condition-recording.cpp +++ b/plugins/base/macro-condition-recording.cpp @@ -31,6 +31,10 @@ static int currentRecordingDurationInSeconds = 0; bool MacroConditionRecord::CheckCondition() { + char *lastSavePath = obs_frontend_get_last_recording(); + SetTempVarValue("lastSavePath", lastSavePath ? lastSavePath : ""); + bfree(lastSavePath); + switch (_condition) { case Condition::STOP: return !obs_frontend_recording_active(); @@ -74,6 +78,14 @@ void MacroConditionRecord::SetCondition(Condition condition) void MacroConditionRecord::SetupTempVars() { MacroCondition::SetupTempVars(); + + AddTempvar( + "lastSavePath", + obs_module_text( + "AdvSceneSwitcher.tempVar.recording.lastSavePath"), + obs_module_text( + "AdvSceneSwitcher.tempVar.recording.lastSavePath.description")); + switch (_condition) { case Condition::DURATION: AddTempvar(