Copy link to clipboard
Copied
I want to keep the "\" in the static text below but the output shows it missing. How can I maintain the "\" in the static text?
{
type: "view",
align_children: "align_top",
alignment: "align_top",
elements:
[
{
type: "static_text",
name: " *Note: Retrieve labeled files from c:\Automatically Labeled Documents folder.",
},
]
},
Copy link to clipboard
Copied
Use 2 backslashes \\
Copy link to clipboard
Copied
Add a "\" before it.
Copy link to clipboard
Copied
Yay! Thx.
Copy link to clipboard
Copied
Hi.
Using 2 backslashes is the old school practice and it's not reliable.
You should use the Unicode ID of the backslash instead, as for the ":", for the "*" and for any special character.
The last line of the script should look like this:
name: "\u002ANote\u003A Retrieve labeled files from c\u003A\u002FAutomatically Labeled Documents folder.",
You can download this free tool to convert any character to its Unicode ID: http://abracadabrapdf.net/download/Texte2Unicode.pdf
Enter your text in the first text field, clic anywhere else and voilà!
Copy link to clipboard
Copied
In French (as in Spanish, Italian, German, etc.), we are used to handling accented and special characters in JavaScript strings.
This JavaScript:
app.alert("\u0044\u00E8\u0073\u0020\u004E\u006F\u00EB\u006C\u0020\u006F\u00F9\u0020\u0075\u006E\u0020\u007A\u00E9\u0070\u0068\u0079\u0072\u0020\u0068\u0061\u00EF\u0020\u006D\u0065\u0020\u0076\u00EA\u0074\u0020\u0064\u0065\u0020\u0067\u006C\u0061\u00E7\u006F\u006E\u0073\u0020\u0077\u00FC\u0072\u006D\u0069\u0065\u006E\u0073\u0020\u006A\u0065\u0020\u0064\u00EE\u006E\u0065\u0020\u0064\u0027\u0065\u0078\u0071\u0075\u0069\u0073\u0020\u0072\u00F4\u0074\u0069\u0073\u0020\u0064\u0065\u0020\u0062\u0153\u0075\u0066\u0020\u0061\u0075\u0020\u006B\u0069\u0072\u0020\u00E0\u0020\u006C\u0027\u0061\u00FF\u0020\u0064\u0027\u00E2\u0067\u0065\u0020\u006D\u00FB\u0072\u0020\u0026\u0020\u0063\u00E6\u0074\u0065\u0072\u0061\u0020\u0021");
Displays this alert:
(Do not look for any meaning in this sentence it is a pangram.)
.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now