title: After Effects extend script to change image in comp
body: <p>I have tried the below After Effects extend script for being able to select an image folder and import an image in the selected comp. But the script line at <code>ImportOptions</code> doesn't work while testing.</p>
  <pre class="lang-js prettyprint-override"><code>function getImage() {
      if (app.project.activeItem instanceof CompItem) {
          var selComp = app.project.activeItem;
          var cname = selComp.name;
          var myTextLayer = selComp.layer(&quot;RAAZI&quot;).property(&quot;Source Text&quot;).value;
          var importOptions = new ImportOptions(File(myPath.fsName + '/' + myTextLayer.text + '.png'));
          var newLayer = app.project.importFile(importOptions);
          var insertLayer = selComp.layers.add(newLayer);
          var xpos = insertLayer.property(&quot;position&quot;).value;          //alert(xpos);
  
          insertLayer.property(&quot;position&quot;).setValue(xpos + [-300, 0]);
      } else {
          alert(&quot;Please select comp&quot;)
      }
  }
  </code></pre>