5 Replies Latest reply on Feb 26, 2010 1:38 PM by miketosch

    Image from Panel to Canvas




      I'm working on a custom Photoshop panel (built in Flex Builder) to allow searching of an image database, with functionality to allow the user to bring a selected image onto the canvas for manipulation.  I'm having a few problems with this.  Hopefully someone has solved this issue and would be willing to share their findings.


      Ideally what I want to happen:

      Flash runtime copies image to system clipboard, then executes an ExtendScript script to paste the clipboard as a new layer.


      Here's the workaround I was thinking (but doesn't work)...

      Since the Flash runtime can only write text to the system clipboard, I was going to Base64 encode the image, put in system clipboard, then have the ExtendScript script decode the clipboard contents and paste in the image object.  This doesn't work as the paste ExtendScript function only works with what is in the clipboard and not some arbitration JS object.  Also, ExtendScript doesn't allow writing (the decoded image) back to the clipboard to do a "normal" paste.
      Another option (will this work?)...
      Write a proper PS plugin that takes the clipboard contents, Base64 decodes image, then pastes to new layer.  The ExtendScript triggered from the Panel would kick start the plugin (can ES talk to plugins?).  I'd prefer not to do this as I'm more of a web/flex developer, not a "desktop" guy.
      Thoughts?  Ideas?
      I'd love to hear your input.
      Mike Tosch