Could not open popup menu...works...then it doesn't
I've created a few track presets and corresponding macros to create a mono audio track and then recall each preset. Each macro works, at least sometimes. I can, for example, create two or three tracks properly, but then the macro will fail. Then it will work again a time or two, but then inevitably it will fail, and then fail permanently until I restart ProTools and Soundflow.
An example of the macro is below.
//Calling command "Audio Track - Mono" from package "Pro Tools" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckp49i4j60000a2100yfwywgf/clxwb51i90000ls10pzla3duo")
sf.soundflow.runCommand({
commandId: 'user:ckp49i4j60000a2100yfwywgf:ckumdk025000hph10fohx90lw#ckum77mkz0004ph106wrckbbu',
props: {}
});
//Calling command "Recall Track Preset on Selected Track" from package "Pro Tools" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckp49i4j60000a2100yfwywgf/clxwb51i90000ls10pzla3duo")
sf.soundflow.runCommand({
commandId: 'user:ckp49i4j60000a2100yfwywgf:ckfs5niws0007v110s447k1ac',
props: {
trackPresetPath: ["Avid","API 4"],
}
});
- JJamie Bolton @Jamie_Bolton
Chris Shaw @Chris_Shaw2024-08-03 17:49:08.860Z
Any time the track list changes in any way (name change, visibility change, new or deleted tracks) you need to refresh the main window cache. The first command in your script / macro changes the track list so before you run it again you'll need to refresh the main window cache by using an invalidate command.
Try this:sf.ui.proTools.mainWindow.invalidate(); //Calling command "Audio Track - Mono" from package "Pro Tools" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckp49i4j60000a2100yfwywgf/clxwb51i90000ls10pzla3duo") sf.soundflow.runCommand({ commandId: 'user:ckp49i4j60000a2100yfwywgf:ckumdk025000hph10fohx90lw#ckum77mkz0004ph106wrckbbu', props: {} }); //Calling command "Recall Track Preset on Selected Track" from package "Pro Tools" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckp49i4j60000a2100yfwywgf/clxwb51i90000ls10pzla3duo") sf.soundflow.runCommand({ commandId: 'user:ckp49i4j60000a2100yfwywgf:ckfs5niws0007v110s447k1ac', props: { trackPresetPath: ["Avid","API 4"], } });
For a thorough explanation of
invalidate()
check out this post from Christian:
When to use invalidate() #post-2