3 Replies Latest reply on Mar 26, 2015 5:07 PM by Trevorׅ

    Why does ESTK get hung up when setting ListItem.image to a string?

    Justin Putney Level 2

      The following code seems to hang up ESTK whether the target is ESTK or InDesign.

       

      try{
      var warning_icon = "\x89PNG\r\n\x1A\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\x00\x00\x00\x1F\xF3\xFF\x61\x00\x00\x00\x19\x74\x45\x58\x74\x53\x6F\x66\x74\x77\x61\x72\x65\x00\x41\x64\x6F\x62\x65\x20\x49\x6D\x61\x67\x65\x52\x65\x61\x64\x79\x71\xC9\x65\x3C\x00\x00\x01\x86\x49\x44\x41\x54\x78\xDA\xA4\x52\xBB\x4A\x03\x51\x10\x9D\x48\xC8\x03\x05\x05\x5D\x88\xA8\x85\x8F\x8D\x11\xAC\x4C\x3A\x41\x4C\x95\x0F\x90\x68\xE1\x0F\x58\x58\x5A\xD9\xEC\xDA\xF8\x19\xDA\x18\x11\x82\x1F\x90\x42\xB4\x09\x56\x06\x4B\x41\x62\xAB\x12\xC1\x22\x45\xDE\x59\xE7\x4C\xF6\xDE\xE4\xAE\x16\x42\x06\xCE\xEE\x99\x33\x67\x66\x6F\x32\x77\xC2\xF3\x3C\x1A\x07\x61\xE2\x78\x2B\x86\xE8\x8F\xD8\x65\xDC\xFB\x3C\xCB\x78\x08\x1A\x56\xF2\x1E\xC9\x94\xD7\x1B\xBC\xAB\x06\x58\xE3\x52\x55\xE0\xF3\x60\x5D\x7A\x27\x30\xA9\xDB\xE5\x47\xAF\xAE\xF1\x52\x58\x75\x67\x52\x47\x3A\x07\x87\x36\xEA\x91\x1E\x0E\x19\xD0\xEB\x61\xCA\xB7\x06\xE7\xCE\x5C\xEA\x40\xE7\xE0\xD0\x02\x9E\xE1\x80\x4E\x07\x8F\x2F\xC1\xF3\x55\xD6\x9D\x5D\xDF\x17\x5E\x74\xB2\x94\xD9\x3E\x11\x0E\x0D\x35\xE5\x93\x1E\x35\x40\x8E\xD3\xF9\x14\x30\x77\x12\xC9\x9D\x41\xAE\x82\x39\x34\xD4\x46\x7C\x81\x13\xB4\xDF\xE9\xB1\x70\xEC\x4A\x33\x73\x81\x0A\x3F\x47\x0D\x1E\x70\xE3\x04\x83\x9F\x20\xA2\xB3\x68\xAF\x09\x07\xAC\x85\x79\x4A\x6F\x4E\xE9\x1C\x35\x78\x7C\xAF\x39\xE0\xEE\xFA\xC2\x5D\xB2\xED\xE1\xD7\x19\x56\x62\x92\xD2\x1B\x9E\xA1\xC1\x03\xAF\x1A\x10\xC2\x2E\x4B\xE7\x72\x91\xBC\xDC\xDE\x16\xFD\x27\x4A\xB7\x15\xE9\xCD\x9D\x7A\xFA\x04\xEE\xB2\x3D\xAD\x37\xA1\x50\xBC\xAC\x50\xE6\x30\xF4\x4B\x87\x17\x3D\xA3\xF7\xC0\x49\xDA\x7D\xE3\x2E\x08\x54\x04\x74\x78\xE5\x5E\x70\x84\xD5\x1A\x6B\x1F\x75\xB2\x2C\xF3\xA8\xF9\x3C\xF0\xC4\x5F\x30\xF5\x5A\x8D\xF4\x1A\x65\x40\xBF\x4F\x67\xE5\x32\x39\xB1\x18\x11\x10\x8F\x13\x45\xA3\x44\x91\x88\xBF\xC5\x36\x51\xAB\x45\xD4\x68\x10\x35\x9B\x03\xA0\x47\xFF\x89\xE3\xC4\x8F\x00\x03\x00\x96\x57\x59\x74\xF3\xF4\xB0\x1A\x00\x00\x00\x00\IEND\xAEB`\x82";
      
      var w = new Window('palette');
      var l = w.add('listbox');
      l.minimumSize = w.minimumSize = [200,-1];
      var item = l.add('item', 'test');
      item.image = warning_icon;
      w.show();
      }catch(e){$.writeln(e);}
      

      I'm basing this on the fabulously helpful work by Marc Autret: Re: get swatches in dropdown list with color preview...

       

      The code runs and the dialog shows up with the working icon, but ESTK gets stuck afterwards. I can't edit the code and do anything useful without restarting ESTK.