No internet connection
  1. Home
  2. How to

Text field input

By Juan B Caballero @Juan_B_Caballero
    2021-02-08 20:50:33.627Z

    Hi! I'm working on some macros and I'm needing this dialog to enter text name for Buonce and I can't find it. Any idea?

    It would be great to be capable of copy the project name as a starting point in the bounce text field, and leave the dialog open to fill with extra data (v1, instrumental, etc.)
    Thanks a lot! I keep diving into this infinite tool

    Solved in post #5, click to view
    • 4 replies
    1. samuel henriques @samuel_henriques
        2021-02-08 21:41:41.323Z

        Hello @Juan_B_Caballero,

        this should do it.
        took it from Command for Bounce Files to the Native Folder on the session, if you want to check it out.

            const bounceName = prompt("Enter bounce name.");
            if (bounceName == "null" || bounceName == null) {
                throw 0;
            }
            if (bounceName == "") {
                log('Cancelled', 'Please enter a valid page number');
                throw 0;
            }
        
            log(bounceName)
        
        1. JJuan B Caballero @Juan_B_Caballero
            2021-02-09 05:13:01.600Z

            Thank you!! I have inserted the script at the end of my macro and it works fine asking me the name, but when I type the name and return, this message appears:

            I tried with a paste action after but it seems there is no text in the clipboard.
            This is my macro. Solo selected tracks and then bounce them 48k no MP3 added and import the bounce file to the project. All other settings are ok. The issue is when I enter the name in the text box (the script you just send me. Enter Name SF in my macro)

            I'll Keep trying! Thanks

            1. samuel henriques @samuel_henriques
                2021-02-09 11:57:53.180Z

                hey @Juan_B_Caballero
                This bits of code will get you what I think you are asking for, but Im not sure in witch order you need to put on your macros.

                ///get session name
                const sessionPath = sf.ui.proTools.mainWindow.sessionPath;
                const sessionName = sessionPath.split('/').slice(-1)[0].split(".").slice(0, -1).join(".")
                
                
                //// prompt ask for Suffix name
                const suffixForSessionName = prompt("Bounce name: " + sessionName + "    Add Suffix :");
                if (suffixForSessionName == "null" || suffixForSessionName == null) {
                    throw 0;
                }
                if (suffixForSessionName == "") {
                    log('Cancelled', 'Enter a suffux for bounce name');
                    throw 0;
                }
                
                
                /// set value on Bounce mix window, File Name
                sf.ui.proTools.windows.whoseTitle.is('Bounce Mix').first.textFields.first.elementSetTextFieldWithAreaValue({
                    value: sessionName + " " +  suffixForSessionName,
                });
                
                
                1. JJuan B Caballero @Juan_B_Caballero
                    2021-02-10 01:46:36.064Z

                    Excellent! This code is perfect! I edited it so that the textbox appears blank. The original code makes a copy of the project name, which is perfect for another macro I'm working on.
                    Thanks!!

                    Reply1 LikeSolution