Error on line 142
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
- samuel henriques @samuel_henriques
Sorry, on line 142
replace
saveWin.getElement('AXDefaultButton').elementClick();
with
saveWin.buttons.whoseTitle.is("Save").first.elementClick();
- In reply toCurtis_Macdonald⬆:Curtis Macdonald @Curtis_Macdonald
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 ??
Curtis Macdonald @Curtis_Macdonald
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.
samuel henriques @samuel_henriques
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?
samuel henriques @samuel_henriques
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" })
Curtis Macdonald @Curtis_Macdonald
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.
samuel henriques @samuel_henriques
Great, sorry it was such a mess to share. I should fix it in the future.
Curtis Macdonald @Curtis_Macdonald
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?
samuel henriques @samuel_henriques
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.Curtis Macdonald @Curtis_Macdonald
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!samuel henriques @samuel_henriques
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
samuel henriques @samuel_henriques
Not line 13, line 180
samuel henriques @samuel_henriques
Published,
Just uncomment line 182Curtis Macdonald @Curtis_Macdonald
Thank you Samuel!