Hi. Is there any way to get the text from a user input dialogue to be able to paste it in Cubase? For example, a popup asks for the track name, and that is used to paste the name into a duplicated track. So basically I need it to be able to either copy to the clipboard for pasting, or is there a way to output the text another way?
Thanks.
- Christian Scheuer @chrscheuer2019-01-01 00:18:49.624Z
- SSteve @stevef
Yes, but I just keep getting an error that the popup text input can’t be used as a string so can’t get it in to the clipboard.
Christian Scheuer @chrscheuer2019-01-01 00:58:31.770Z
You're most likely missing to access the specific property of the result of the popup call. Can you share the code?
Christian Scheuer @chrscheuer2019-01-01 01:00:17.560Z
All actions in SF return an object consisting of multiple properties. I don't remember exactly which property to access for the popup text but if you type a dot after the call you should get code completion to help you access the right result property
- In reply tostevef⬆:Jesper Ankarfeldt @JesperA2019-01-01 01:12:56.682Z
Hey Steve.
Here's some key elements for you:
var input = sf.interaction.popupText({ title: 'Text for popup window' }).text;
sf.clipboard.setText({text: input})Then just create a scripts that starts with the above, then duplicate the track, rename it, and paste the above with sf.keyboard.press({keys: 'cmd+v'})
You can also go the other way, if you want to get the text/title from an existing track:
sf.keyboard.press({keys: 'cmd+c'}); //copies selected text
var input = sf.clipboard.getText().text; //adds the text to the variable.Now you can use the text within soundflow, modify it etc.
If you want it to persist between scripts, instead of input use globalstate.input.You might also wanna check out this video. I've attached scripts to it: https://www.youtube.com/watch?v=Ad2HujsvijI&index=2&list=PLS5FeGiB8oQ57BnC88QPwBar0XpOkcF2e
But some parts/elements are already a bit dated, but using same technics as aboveJesper Ankarfeldt @JesperA2019-01-01 01:15:25.696Z
Btw. the videos was prior sf.interaction, so in those script I'm using applescript popup as input. But maybe check the one for adding Audio, as I'm splitting up a text for multiple things.
- In reply toJesperA⬆:SSteve @stevef
Brilliant, thanks @JesperA! This solved it - sf.clipboard.setText({text: input}) - I was almost there, just didn't't get the formatting of the part in brackets right. All works now.