I was able to boil your script down, to what I need. Works great in extendscript, but for some reason, only shows a portion of the image in photoshop and illustrator. This was happening even before i boiled it down. Thoughts? The last thing I'm trying to do with it, is figure out if I can set a transparent background for the window. I also tried using backgroundColor, but was unable to set the attribute correctly... there is a lot to learn with Adobe scripting. I also couldn't find reference to what DELTA_H is, I have a bunch of their PDFs, and googled, but couldn't find reference to this. I'm trying to be resourceful so I don't have to ask such remedial questions.
Here's the revised script, and a link to the image I labelled test on my desktop: http://img2.wikia.nocookie.net/__cb20110725041802/logopedia/images/8/89/Logo_rolling_stone s.png
PreviewWindow = function() {
};
w = 285;
h = 313;
PreviewWindow.DELTA_H = 1;
PreviewWindow.open = function(file, w, h, title, ms) {
PreviewWindow.openFile(file, w, h, title, ms);
};
PreviewWindow.openFile = function(file, w, h, title, ms) {
var type = (ms > 0) ? 'palette' : 'dialog';
var win = new Window(type, title || "Preview: " + decodeURI(file.name),undefined,{borderless : true});
win.preview = win.add('image', undefined);
win.preview.icon = file;
win.show();
if (ms > 0) {
$.sleep(ms);
}
delete win;
$.gc();
};
PreviewWindow.open("~/Desktop/test.png", undefined, undefined,
"Preview Test", 500);