Set color from a .txt file?
Hi,
I have a .txt file on my desktop which only contains 1 line of text: #79a3d2
I also have the following code inside a .jsx file"
var fileToParse = File ('/Desktop/Photoshop.txt');
fileToParse.open('r');
var NewColor = fileToParse.readln();
fileToParse.close();
var color = app.foregroundColor;
color.RGBColor.hexValue=NewColor;
app.foregroundColor = color;
I am trying to change the foreground color to the hexadecimal code inside the text file, but I receive an error saying "Undefined is not an object"?
Can someone please tell me what is wrong with my code (in layman terms)?
Thank you all in advance.
