-
1. Re: [JS][CS5] ScriptUI
Peter Kahrel May 30, 2011 1:13 AM (in response to Roy Marshall)You need a reference to a file object, and I think you'll therefore have to download the image, then create a local reference.
Peter
-
2. Re: [JS][CS5] ScriptUI
Harbs. May 30, 2011 2:24 AM (in response to Peter Kahrel)Or read the binary data and feed that in as a hex string...
Harbs
-
3. Re: [JS][CS5] ScriptUI
Roy Marshall May 30, 2011 2:33 PM (in response to Harbs.)HI Harbs.
I did see a post by Marc Autret where he used a "serialised PNG" file. I guess that is what you mention.
How do I process the string from an existing icon, and the the correct syntax for reading it back in? Can you help with this?
Cheers
Roy
-
4. Re: [JS][CS5] ScriptUI
Peter Kahrel May 31, 2011 6:22 AM (in response to Roy Marshall)Roy,
This post: http://forums.adobe.com/message/2326630#2326630 shows a method used by Bob Stucky. There's quite a bit of code there, but it shows how to create a resource string from a PNG file and use that string in a script.
Peter
-
5. Re: [JS][CS5] ScriptUI
Marc Autret May 31, 2011 7:17 AM (in response to Roy Marshall)Roy Marshall wrote:
How do I process the string from an existing icon, and the the correct syntax for reading it back in? Can you help with this?
Here is the basic idea:
function serializeFile(/*str*/path) { var f = new File(path), s = null; if( f && (f.encoding='BINARY') && f.open('r') ) { s = f.read(); f.close(); } return s && s.toSource(); } alert( serializeFile("/path/to/my/file.png") );@+
Marc



