No internet connection
  1. Home
  2. How to

Why did he stop working? "session auto-save"

By Yujiro Yonetsu @Yujiro_Yonetsu
    2024-01-26 10:41:51.183Z

    Hello.

    The Pro Tools autosave feature is unreliable.
    It often slacks off.
    So, I've been using a script to perform a save session at regular intervals.
    However, this script has stopped working entirely with the recent version.
    Can you tell me the cause?
    Ventura 13.6.3
    Pro Tools 2023.12.1

    
    var pollingIntervalMs = 60000;
    
    
    sf.engine.runInBackground(function () {
    
    
        while (true) {
    
            sf.engine.checkForCancellation();
    
            if (sf.ui.proTools.mainWindow.invalidate().sessionPath !== null) {
    
                //Calling command "If Menu Item Is Enabled" from package "Basics" (installed from user/pkg/version "srAasovvDiQacRZ2mcId4RrOA8R2/ckuxffxq80000u010m7g02u3l/cll0rgzcl00003k107vghms2d")
                sf.soundflow.runCommand({
                    commandId: 'user:ckuxffxq80000u010m7g02u3l:ckuxfj0cn0003u010jcnoh0dg',
                    props: {
                        application: sf.ui.proTools,
                        menuPath: ["File", "Save Session"],
                    }
                });
    
    
            }
    
            sf.wait({
                intervalMs: pollingIntervalMs,
                executionMode: 'Background'
            });
        }
    
    });
    
    • 2 replies
    1. Can you post a screen shot of how your ""If Menu Item Is Enabled" from package "Basics" macro is configured?

      1. Yujiro Yonetsu @Yujiro_Yonetsu
          2024-01-31 21:33:19.630Z

          I'm sorry about this.
          It seems that various adjustments caused it to enter a strange state.
          I have no memory of inserting such a sentence...

          Here is the latest script:

          
          var pollingIntervalMs = 60000;
          
          sf.engine.runInBackground(function () {
          
          
              while (true) {
          
                  if (sf.ui.frontmostApp.activeBundleID !== "com.avid.ProTools") return;
          
                  sf.engine.checkForCancellation();
          
                  if (sf.ui.proTools.mainWindow.invalidate().sessionPath !== null) {
          
                      sf.ui.proTools.menuClick({
                          menuPath: ["File", "Save Session"],
                      });
          
                  }
          
                  sf.wait({
                      intervalMs: pollingIntervalMs,
                      executionMode: 'Background'
                  });
              }
          
          });
          
          

          Although it seems to be working fine for now, I believe its weakness is that the selection is deselected when a menu or clip is selected.
          How can I avoid this?
          Thank you.