No internet connection
  1. Home
  2. Script Sharing

Open Selected File in Dolby Atmos Renderer Master

By David Stagl @David_Stagl
    2023-04-26 21:06:39.993Z

    I am trying to select a file in the finder and then open it in the Dolby Atmos Renderer. I've been trying to reverse engineer some different scripts to do this, but I can't get it working. I'm stuck on how to navigate to the file I selected in the finder in the "Open Master File" dialogue.

    • 1 replies
    1. Nathan Salefski @nathansalefski
        2023-07-17 22:47:11.626Z

        This should do the trick. It will prompt you for the file location, then open that file.

        //Activate Renderer
        sf.ui.app("com.dolby.atmos.renderer").appActivate();
        
        const openWin = sf.ui.app("com.dolby.atmos.renderer").mainWindow.sheets.whoseDescription.is("choose a file").first
        
        // Prompt for File with Option To Cancel
        let importDirectory = sf.interaction.selectFile({
            prompt : `Select File to Open`,
        }).path;
        
        //Refresh Cache
        sf.ui.app("com.dolby.atmos.renderer").mainWindow.invalidate();
        
        //File, Open Master File
        sf.ui.app("com.dolby.atmos.renderer").menuClick({
            menuPath: ["File","Open Master File"],
        });
        
        //Wait for 'Open' Window to Appear
        openWin.elementWaitFor();
        
        //Open 'Go' Sheet
        sf.keyboard.type({ text: '/' });
        
        //Wait for 'Go' Sheet Window to Appear
        openWin.sheets.first.elementWaitFor();
        
        //Set Destination
        openWin.sheets.first.textFields.first.elementSetTextFieldWithAreaValue({
            value: `${importDirectory}`,
            //onError: "Continue",
        });
        
        //Press Return
        sf.keyboard.press({
            keys: "return",
        });
        
        //Click Open
        openWin.buttons.whoseTitle.is("Open").first.elementClick();