13 Replies Latest reply on Jul 21, 2016 2:14 PM by RicSum

    Set color from a .txt file?

    RicSum Level 1


      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');
      var NewColor = fileToParse.readln();
      var color = app.foregroundColor;
      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.