Try:
app.currentWorkspace.name
I use this to determine where in an ordered list of workspaces the user is for `TA_loadWorkspaceNext() and ` TA_loadWorkspacePrevious()` functions.
I’m not sure I follow what you mean by “resulting string”, do you mean something like this?
let strText = "lorem ipsum";
app.setClipboard(strText);
console.log(strText);