3 Replies Latest reply on Jul 23, 2016 8:04 AM by RicSum

    Path or Syntax error?

    RicSum Level 1

      Hi,

      If I use the code below - I receive no errors:

       

      #target photoshop
      var fileToParse = File (Folder.desktop + '/PhotoshopColor.txt'); 
      fileToParse.open('r'); 
      var NewColor = fileToParse.readln(); 
      fileToParse.close(); 
      app.foregroundColor.rgb.hexValue=NewColor;
      

       

      However, when I move the txt file to a different location, and then change the code to that below - I receive an error saying Exception:SyntaxError: Expected: )

       

      #target photoshop
      var fileToParse = File (/Users/richard/Library/Application\ Support/Test\ Data/PhotoshopColor.txt);
      fileToParse.open('r'); 
      var NewColor = fileToParse.readln(); 
      fileToParse.close(); 
      app.foregroundColor.rgb.hexValue=NewColor;
      

       

      It seems to be telling me that a close parenthesis is missing, but my code seems to indicate otherwise.

       

      Can anyone please help me?

      Thank you all in advance.