I have a script that copies the current file name that's in the Bounce Name text field. Than i have a prompt that asks what to name the file, and should show the Clipboard text (so you knonw what the current name is if you want to keep it).
This is the message i get: What would you like your File Name to be? Your Clipboard text is SoundFlow.Shortcuts.Automation.Actions.ClipboardGetTextResult
Not sure what that means or how to fix it.
Thanks so much for the help!
// Copy current file name to clipboard in case you want it.
sf.ui.proTools.windows.whoseTitle.is('Bounce').first.textFields.first.elementClick();
sf.keyboard.press({
keys: "cmd+a, cmd+c",
});
sf.wait({
intervalMs: 500,
});
// Prompt for file name
var clipboardText = sf.clipboard.getText();
var fileName = prompt("What would you like your File Name to be? " + "Your Clipboard text is " + clipboardText);
// Place file name into FILE NAME field.
sf.ui.proTools.windows.whoseTitle.is('Bounce').first.textFields.first.elementSetTextFieldWithAreaValue({
value: fileName,
});

- Christian Scheuer @chrscheuer2020-10-18 11:58:40.153Z
Hi Mike,
You need to take the
text
output variable of thegetText()
action call:var clipboardText = sf.clipboard.getText().text;
Mike Wax @mikewax
Dam, i was so close!
So The text I was getting was basically just pulling the function, which is why i was getting that message? And adding the
.text;
converts it to text?Mike Wax @mikewax
Ok, quick follow-up question...how do i stylize the text that i'm putting in the prompt?
So for this text:
var fileName = prompt("What would you like your File Name to be? " + "Your Clipboard text is " + clipboardText);
How could i make it this?
var fileName = prompt("What would you like your File Name to be? " + <br /> + "Your Clipboard text is " + <b>clipboardText</b>);
If that makes sense?
Thank you!Christian Scheuer @chrscheuer2020-10-19 10:59:22.668Z
Hi Mike,
And adding the .text; converts it to text?
Kind-of.. All SoundFlow actions return an object consisting of multiple potential properties. So you always need to specify the specific output property you want. There's no actual conversion happening, but yes you're telling SF that you want the text output of the clipboard getText action by adding the
.text
Unfortunately,
prompt
doesn't support rich text formatting.
Instead, you could add a return:var fileName = prompt("What would you like your File Name to be?\nYour Clipboard text is:\n\n" + clipboardText);
Mike Wax @mikewax
Bummer about the formatting, but the rich text at least helps.
Totally makes sense on the SoundFlow actions.
Thank you so much!