0 Replies Latest reply on May 26, 2016 7:41 AM by namechange02.03.2017

    shell out on a Mac

      Never worked on a Mac. Since you can't copy a string to the clipboard (pasteboard) in JS directly I tried this:

      var folderForTempFiles = Folder.temp.fsName;
      var clipboardShName = folderForTempFiles + "/ClipBoard.sh";
      var clipShFile = new File(clipboardShName);
      clipShFile.open('w');
      clipShFile.write("cat " + clipboardTextFileName + " | pbcopy");
      clipShFile.close();
      clipShFile.execute();

      this code works on a Windows system with the obvious changes of making the file .bat using a command to copy the file to 'clip'.

      However, a Mac user who tried this said didn't work.

      What do I need to tweak it?

      The text is already written to the clipboardTextFileName file.


      Thanx.