I have a program I'm using to write xml with variables, and it passes through AppleScript and bash to form the final xml. However, one of my variables usually begins with "024", "054", or other three digit codes that paired with the "\" forms an octal character, like "," for "\054". Once they are passed through bash, they become replaced with these octal characters. These variables need to stay the way they are, because they are part of a file path the xml ultimately pulls from. Unfortunately, I can't change these variables because they're linked to many other things working properly, and the backslashes are obligatory too. I want to know if there is a way to stop AppleScript from implementing octal encoding on this script as it passes through. A colleague recommended using iconv, which I tried unsuccessfully, partially because I'm not sure how to use it properly. Here is the AppleScript for reference:
do shell script "echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?> <scratch project=\\\"TEST\\\"> <file>W:\\Sequences\\087_TLD_TL_Taking_The_Lead\\Shots\\TLD0640\\Versions\\MOV\\TLD0640_v0173.mov\\</file> </scratch>\" > ~/Desktop/Test.xml"
And the output:
<?xml version="1.0" encoding="UTF-8"?> <scratch project="TEST"> <file>W:\Sequences87_TLD_TL_Taking_The_Lead\Shots\TLD0640\Versions\MOV\TLD0640_v0173.mov\</file> </scratch>
Thank you for your help!
Edit: thanks Gordon Davisson for making the code viewable, and updated the codes to the bare minimum for reproducing the question.