Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

ScriptUI: replacing images

$
0
0

When you use graphic files (such as PNGs) for images, you can change the contents of an image control. The following script sets an image (iconA) but immediately replaces it with iconB, so that by the time the window is displayed, iconB is the one you see:

 

iconA = File ('. . . ..png');
iconB = File ('. . . ..png');

w = new Window ('dialog');
    icon = w.add ('image', undefined, iconA);    icon.image = iconB;
w.show();

 

But when you use strings for icons, as in this script:

 

iconA = "\u0089PNG\r\n\x1A\ . . . `\u0082";
iconB = "\u0089PNG\r\n\x1A\ . . . `\u0082";

w = new Window ('dialog');
    icon = w.add ('image', undefined, iconA);    icon.image = iconB;
w.show();

 

the image is not replaced.

 

Does anyone know how to replace images using strings?

 

Thanks,

 

Peter


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>