Create a Text Pop Up Box
Hi,
I'm trying to create a Pop up Text box for various commands. One of them for instance is if I use this macro below to highlight the "Source Tempo" inside the "Elastic Properties" window where I can now enter the bpm. I would like for a Text Box to appear where I enter the value and it enters it in the "Source Tempo" field.

I found this and tried to add it before or after and the Pop Up Box showed up but when I entered a value, it just closed and didn't put it into the "Source Tempo Field".
var myVariable = prompt("Enter some text");
Any help is greatly appreciated.
Thanks
- Nathan Salefski @nathansalefski
You can use this Display Dialog and then find the text field you'd like to edit and use something like
textField.elementSetTextAreaValue({ value: tempo });
let tempo = sf.interaction.displayDialog({ prompt: "Tempo", defaultAnswer: "", buttons: ["Cancel", "OK"], defaultButton: "OK", }).text;
Thank you for your help, @nathansalefski. However, I am still unable to understand the solution. I have copied and pasted the script that you shared and added it after the macro. Although the dialog box pops up, when I press "Enter", it closes without changing the value in the Source Tempo field.
- In reply tonathansalefski⬆:
I tried this as well...
let tempo = sf.interaction.displayDialog({ prompt: "Tempo", defaultAnswer: "", buttons: ["Cancel", "OK"], defaultButton: "OK", }).text; sf.ui.proTools.windows.whoseTitle.is("Elastic Properties").first.groups.whoseTitle.is(",j").first.textFields.whoseTitle.is("mSourceTempoField").elementSetTextAreaValue({ value: tempo });
Sorry, I'm new to the javascript stuff
Nathan Salefski @nathansalefski
No worries. Certain text boxes require you to use your mouse and keyboard. Try this out:
let tempo = sf.interaction.displayDialog({ prompt: "Tempo", defaultAnswer: "", buttons: ["Cancel", "OK"], defaultButton: "OK", }).text; let elasticPropWin = sf.ui.proTools.windows.whoseTitle.is("Elastic Properties").first; elasticPropWin.groups.whoseTitle.is(",j").first.textFields.whoseTitle.is("mSourceTempoField").first.elementSetTextFieldWithAreaValue({ useMouseKeyboard: true, value: tempo });
This was flawless! Thank you @nathansalefski.
In addition, I would like to request a feature that allows me to open the Elastic Properties window first and then close it after entering the Tempo. Also, I'm curious if there is a way to learn all the codes, names, functions, and other related information by myself. I would appreciate it if you could let me know.