Is there a more robust method than DoForEachSelectedClip?
Hello,
I am working on a script that utilizes clipDoForEachSelectedClip.
However, this has some strange properties that make it not very useful.
(Like the fact that the time counter is forced to be a sample......)
Is there any other way to do the same thing?
For example, here's a script that I'm having trouble making right now
function safePrepost() {
sf.ui.proTools.menuClick({
menuPath: ["View", "Main Counter", "Timecode"],
});
sf.wait({ intervalMs: 50, });
sf.keyboard.press({
keys: "tab",
});
sf.wait({ intervalMs: 50, });
sf.keyboard.press({
keys: "shift+tab",
});
sf.wait({ intervalMs: 90, });
var space2 = sf.ui.proTools.selectionGet().selectionLength.split(":").join("");
var space2num = Number(space2);
if (space2num >= 1) {
sf.keyboard.press({
keys: "option+control+tab",
});
sf.ui.proTools.nudgeSet({
value: "00:00:07:00.00",
});
sf.keyboard.press({
keys: "command+numpad plus",
});
} else {
sf.keyboard.press({
keys: "option+control+tab",
});
sf.ui.proTools.menuClick({
menuPath: ["Edit", "Trim Clip", "To File End"],
});
}
sf.wait({ intervalMs: 90, });
//sf.keyboard.press({
// keys: "control+tab",
//});
sf.ui.proTools.nudgeSet({
value: "00:00:02:00.00",
});
sf.wait({ intervalMs: 90, });
sf.keyboard.press({
keys: "option+numpad minus",
});
sf.wait({ intervalMs: 90, });
sf.ui.proTools.nudgeSet({
value: "00:00:07:00.00",
});
sf.wait({ intervalMs: 90, });
//sf.keyboard.press({
// keys: "tab",
//});
sf.wait({ intervalMs: 90, });
}
sf.ui.proTools.clipDoForEachSelectedClip({
action: safePrepost,
onError: 'Continue',
});
I want to extend the beginning and end of all selected clips.
I'd like to get some suggestions.
Please help me!
Best
- Yujiro Yonetsu @Yujiro_Yonetsu
Hello.
I've been thinking about it.Is it possible to do something like what is in this thread for clips?
Or am I taking a futile detour?
Please advise.
Yujiro Yonetsu @Yujiro_Yonetsu
hmmmmmm :(
I have been thinking about it a lot but can't come up with a method.
I would appreciate any help anyone can give me.
Best!
- In reply toYujiro_Yonetsu⬆:Christian Scheuer @chrscheuer2022-03-30 09:19:23.354Z
Hi Yujiro,
It's pretty difficult to write a stable implementation of this with all the corner cases (ie. fades, crossfades, etc., overlapping clips), which is why SoundFlow needs to be in Samples mode to keep track of the current selection while doing its work.
If the only thing you don't like about the current implementation is the fact it switches to Samples, you could just switch to another time factor while doing your processing for each clip and switch back to Samples. That would be a stable approach.
If you want to come up with an entirely new implementation, it's likely to be a lot of work to get it working for all corner cases. The clipDoForEachSelectedClip is hugely complex internally.