Sequential Markers BUT BETTER (and a bit more complicated to code)
Hello again!
Thank you very much for the help last time with creating sequential markers.
I now face a need for deeper programming, and im stuck!
__
GOAL: place sequential markers with the following rules:
_
STEP 0 (no soundflow) - I manually select the region that will have a marker placed in the middle of.

STEP 1 (now on soundflow) - Delete the gap.
STEP 2 - Add 2 seconds of silence
STEP 3 - Press left arrow to be at the end of the previous phrase.
STEP 4 - Apply rules!
A. IF the waveform of the previous phrase ends AFTER the respective .5 second, go to the NEXT second, add ONE SECOND of silence.
Read the timecode or selection timecode (pictured bellow). I believe there is a function in SOUNDFLOW can read the UI, or at least select the numbers, copy it, and use the information within the clipboard?


Bellow is the screenshot showing the priovous phrase's waveform ending after the 0.5 second decimal.





B. If the phrase's waveform end BEFORE the 0.5 seccond decimal, go to next seccond, place a marker. For this process, steps are similar.
Enable SNAP button, this brings us to the PREVIOUS 0.0 decimal point, click right arrow, place marker.

Help on this would be greatly appreciated. Im trying to fully integrate my company's editing workflow within SOUNDFLOW. This is the last key in the puzzle from my audacity deck. Please help me close the gap so i can get a real big group of licenses going!
Much much MUCH love,
The biggest trapper around.
P.S. MY SCRIPT AS IT STANDS, bellow
sf.ui.app("org.audacityteam.audacity").mainWindow.children.whoseRole.is("AXUnknown").whoseTitle.is("Snap").first.elementClick();
sf.ui.app('org.audacityteam.audacity').menuClick({
menuPath: ["Generate","Silence..."],
});
sf.keyboard.press({
keys: "2, 0, 0, 0",
});
sf.keyboard.press({
keys: "return",
});
sf.keyboard.press({
keys: "right",
});
sf.ui.app("org.audacityteam.audacity").mainWindow.children.whoseRole.is("AXUnknown").whoseTitle.is("Snap").first.elementClick();
if (event.keyboardState.hasAlt) {
globalState.audacityLabelNumber = undefined;
log("The label number has been reset.");
} else {
// Initialize a persistent variable to track the label number
globalState.audacityLabelNumber = globalState.audacityLabelNumber || 1;
const labelText = String(globalState.audacityLabelNumber);
sf.clipboard.clear();
sf.clipboard.setText({ text: labelText });
sf.clipboard.waitForText();
const audacity = sf.ui.app("org.audacityteam.audacity");
audacity.menuClick({
menuPath: ["Edit", "Labels", "Paste Text to New Label"]
});
// Accept label text
sf.keyboard.press({ keys: "return", });
// Increment the label number for the next run
globalState.audacityLabelNumber++;
}