I'm trying to alert users to the location renders were saved by using the toString() method.
The resulting alert gives a %20 instead of a space. How do I correct this?
alert("Please select a render folder.\r\n"+
"When the script has finished you will collect your renders from this folder location.");
var newRenderLocation = folderGetDialog("Select a destination to render comps.");
alert("Render Complete. \r\n" +
"Collect renders from saved location." + newRenderLocation.toString());
Any help is much appreciated,
Shawn
[Solved] Using toString() method to alert directory path...
Moderator: Paul Tuersley
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
Here's an example showing one way to do it. It uses the .split() string method, to break the original string into an array of strings separated by occurrences of %20. Then it puts them back together with spaces between them.
Code: Select all
var theString = "text%20with%20spaces"
var theSplit = theString.split("%20");
var newString = theSplit[0];
for (x = 1; x < theSplit.length; x++) {
newString += " " + theSplit[x];
}
alert(">" + newString + "<");
You could also use the built-in function decode(). Every special character will be decoded.
Code: Select all
alert(Folder.decode(newRenderLocation));