Sample Header Ad - 728x90

How can I stop AppleScript from converting variables like "\087" into their octal form when passing through bash?

1 vote
1 answer
85 views
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 \" W:\\Sequences\\087_TLD_TL_Taking_The_Lead\\Shots\\TLD0640\\Versions\\MOV\\TLD0640_v0173.mov\\ \" > ~/Desktop/Test.xml" And the output: W:\Sequences87_TLD_TL_Taking_The_Lead\Shots\TLD0640\Versions\MOV\TLD0640_v0173.mov\ 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.
Asked by Brandon Steenhoek (11 rep)
Jul 12, 2019, 12:49 AM
Last activity: Jul 12, 2019, 12:49 PM