No internet connection
  1. Home
  2. Packages
  3. Lista de Musica

Error on line 142

By Curtis Macdonald @Curtis_Macdonald
    2022-02-24 17:29:24.760Z2022-02-24 17:37:38.580Z

    Thanks for sharing this script @samuel_henriques ! I made the customizations from "Lista De Musica" to "MUISCLIST" as you suggested here: Automated Music cue sheet #post-47

    But I'm still getting an error on 142 - same as before, "ClickButtonAction requires UIElement" when PT tries to save text location.

    Any ideas why? Thank you SO much

    • 14 replies
    1. samuel henriques @samuel_henriques
        2022-02-24 17:50:29.148Z

        Sorry, on line 142

        replace

         saveWin.getElement('AXDefaultButton').elementClick();
        

        with

        saveWin.buttons.whoseTitle.is("Save").first.elementClick();
        
        1. Curtis Macdonald @Curtis_Macdonald
            2022-02-24 18:30:59.701Z

            Cool! I think we're getting closer!

            I think the script is a little confused with session re-naming, am getting an error on line 278 now, "Could not set text area value"

            Also see this in my session folder:

            Seems like the script is removing some characters or words from my session file name ??

            1. Curtis Macdonald @Curtis_Macdonald
                2022-02-24 18:45:10.688Z2022-02-24 19:27:01.344Z

                I think there's an extra "/" somewhere when the script is trying save the spreadsheet to the specified folder:

                And, instead of specifying a separate directory, is there a way to have the cue sheet saved to the Session File folder instead?

                THANK YOU @samuel_henriques , I'm very excited about this script you've created.

                1. samuel henriques @samuel_henriques
                    2022-02-24 19:34:37.755Z

                    Ok, I'm sorry, I published this as my and my team version so it's natural this is happening. Never got anyone using it or if they did they changed it.
                    Bear with me and we'll get there.

                    So far it's creating the excel file?

                    1. samuel henriques @samuel_henriques
                        2022-02-24 19:47:58.815Z2022-02-24 19:54:21.459Z

                        Replace lines 331 to 354 with:

                        const sessionPath = sf.ui.proTools.invalidate().mainWindow.sessionPath;
                        const sessionFolderPath = sessionPath.split("/").slice(0, -1).join("/");
                        const sessionName = sessionPath.split('/').slice(-1)[0].split('.').slice(0, -1).join('.');
                        const appendToName = "MUSICLIST"
                        
                        let newSessionName = sessionName + "_" + appendToName
                        
                        const cueParentFolder = "~/Desktop/CUE SHEET";
                        /// Destination Folder Name
                        const folderadressandcombinedName = cueParentFolder
                        
                        //  create folder if it doens't exist
                        sf.file.directoryCreate({ path: folderadressandcombinedName, onError: "ThrowError" })
                        
                        1. Curtis Macdonald @Curtis_Macdonald
                            2022-02-24 21:26:54.097Z2022-02-24 21:40:03.245Z

                            no worries at all, and thank you so much for all your help with this

                            I've adjusted the code and the script is now completing YAY!

                            I found the bit of code that removed fades, which I commented-out for my workflow.

                            EDIT: session file name and spreadsheet name now works as expected too!

                            Wow this is cool.

                            1. samuel henriques @samuel_henriques
                                2022-02-24 21:49:07.606Z

                                Great, sorry it was such a mess to share. I should fix it in the future.

                                1. Curtis Macdonald @Curtis_Macdonald
                                    2022-11-08 23:51:08.782Z

                                    Hi again Samuel! It's been a while since I've run this script, and for some reason I'm now getting an error on line 73: Command Error: Default Preset ... Couldn't locate AxElementArrayIndexedItem

                                    not sure why it's happening, might be a chance in mac os x?

                                    1. samuel henriques @samuel_henriques
                                        2022-11-09 11:03:15.260Z

                                        Hello Curtis,
                                        The current version should take care of this. Since Monterey the navigation on this window is different.
                                        The lines you had to change are now after line 428.

                                        1. Curtis Macdonald @Curtis_Macdonald
                                            2022-11-09 16:58:43.510Z

                                            Awesome, just updated to the new version, made a few tweaks and it's working great! I really love this script.
                                            Quick follow up question: what do you recommend is the best way to remove the last five characters from the .txt file? (Am trying to remove the auto-created "-00.L" and similar post-fixes that PT generates on clips.)
                                            Thanks again!

                                            1. samuel henriques @samuel_henriques
                                                2022-11-09 18:47:28.859Z

                                                Cool.
                                                To clean the auto created bit:
                                                On line 180 replace:

                                                 .join().split('\t').map(item => item.replace(/\,/g, "").trim())
                                                

                                                with:

                                                 .join().split('\t').map(item => item.replace(/\,/g, "").replace(/-\d+.(L|R|A\d+)/g, "").trim())
                                                

                                                Ill update a version where you can choose to have this or not by commenting or not a bit

                                                1. samuel henriques @samuel_henriques
                                                    2022-11-09 18:52:04.527Z

                                                    Not line 13, line 180

                                                    1. samuel henriques @samuel_henriques
                                                        2022-11-09 18:55:52.468Z

                                                        Published,
                                                        Just uncomment line 182

                                                        1. Curtis Macdonald @Curtis_Macdonald
                                                            2022-11-09 22:03:57.803Z

                                                            Thank you Samuel!