How can I change a string into a byte value

I want to save a file with a textstring. However, I don’t want to write a textfiled.

How can I change a textstring into a byte value to use writeFile();;

Do you want to write a binary file instead of text file?

Bingo Robert. That’s what I want to do…

Is this what you are looking for?

var myText = "some text";
var myArray = [];
for ( var i = 0 ; i < myText.length ; i++ )
{
	myArray[i] = myText.charCodeAt(i);
}
application.writeFile("testbinary", myArray);