I’m trying to find and replace text within a variable, NOT draft contents, and I’m having some trouble.
Script Error: TypeError: p.fieldValues["project"].replace is not a function. (In 'p.fieldValues["project"].replace(" ","%20")', 'p.fieldValues["project"].replace' is undefined)
Line number: 23, Column 54
Here is the snippet of my script:
var p = Prompt.create(); p.title = "Pick a project"; p.message = "What project is it for?" p.addSelect("project", "Project", selections, , false) p.addButton("OK"); var selection = p.show() var target_project = p.fieldValues["project"].replace(" ","%20") app.setClipboard(target_project)
Any ideas on how to go about this? Also open to another way to pass the prompt result into a valid url.