Coding a pop up text box..
Hey all.
Is there a way to code a text input box to pop up for me to input variables that wi need to be used repeatedly in a bounce script?
For example I have a script that bounces a bunch of tracks in a sequence. Currently it names those bounces with the name of the track it is bouncing.
It would be dope if I could have a text input at the beginning of the script to enter file naming structure and a second for sample rate/bit depth.
So the bounced file name would go from
“Kick”
To
(User entered variable 1)Kick(User entered variable 2)
Finally result might look like this
JR_Titan Theme_MH 1_Kick_96k24
Thanks
- Christian Scheuer @chrscheuer2022-01-22 17:16:52.299Z
Hi Matt,
You can use
prompt
- but only for one variable at a time.Like:
var bounceName = prompt(`Please type the name of the bounce`);
- MIn reply toMatt_Hennessy⬆:Matt Hennessy @Matt_Hennessy
That’s dope - exactly what I was looking for. Will work with this on Monday but I bet this is exactly what I was looking for thank you!
- MIn reply toMatt_Hennessy⬆:Matt Hennessy @Matt_Hennessy
@chrscheuer follow up question.
Is there a way to pull system information like the date?
For some file naming scripts it would be VERY cool to be able to pull date data and place it at the end of the name string formatted year/month/day.
Ex; 220122
Thanks 🙏🏼
Dustin Harris @Dustin_Harris
HI @Matt_Hennessy! Try this for today's date:
let todaysDate = new Date().toDateString(); log(todaysDate); //Sat Jan 22 2022
- In reply toMatt_Hennessy⬆:
Dustin Harris @Dustin_Harris
oh, and the way you want it formatted:
const date = new Date(); const year = date.getFullYear() const month = String(date.getMonth()+1).padStart(2, "0") const day = String(date.getDate()).padStart(2, "0") const formattedDate = `${year}/${month}/${day}` log (formattedDate)
- MMatt Hennessy @Matt_Hennessy
So I add both of those code blocks and then
“Todaysdate” is the way I add that to the text string?
Dustin Harris @Dustin_Harris
yeah exactly! I'd do it like this:
const date = new Date(); const year = date.getFullYear() const month = String(date.getMonth()+1).padStart(2, "0") const day = String(date.getDate()).padStart(2, "0") const formattedDate = `${year}/${month}/${day}` var bounceName = prompt(`Please type the name of the bounce`); var bounceNameWithDate = bounceName + formattedDate; log(bounceNameWithDate)
- MMatt Hennessy @Matt_Hennessy
In this example the date would print
2022/01/22 right?
I would want it to say
220122
Dustin Harris @Dustin_Harris
coming right up!
const date = new Date(); const year = date.getFullYear().toString().slice(-2) const month = String(date.getMonth()+1).padStart(2, "0") const day = String(date.getDate()).padStart(2, "0") const formattedDate = `${year}${month}${day}` var bounceName = prompt(`Please type the name of the bounce`); var bounceNameWithDate = bounceName + "_" + formattedDate; log(bounceNameWithDate)
- In reply toDustin_Harris⬆:MMatt Hennessy @Matt_Hennessy
Oh i see.
Formatteddate. Cool! Can’t wait to dive in on this
- MMatt Hennessy @Matt_Hennessy
Amazing - thanks so much @Dustin_Harris
You guys really are so wonderful. 🙏🏼❤️