Before I dig deeper, is this the old script? Because there may be a built-in updated version of this in 2015.1 beta.

"Combine Icons" batch operation not working in RWIE...
Hi Vlasta,
I'm trying to use your batch op that you wrote, to combine a bunch of icons. They are .png files of different sizes.
Screenshot: http://i.imgur.com/duu0OKJ.png
(this only shows a small portion--they are in different folder)
I keep getting "Object does support this property of method."
I tried changing the the "Open as:" from Layer Image to "Raster" "Rendered" and "Not set." None of those worked...
Any ideas what I might be going wrong? I'm using RWIE 2015.1 on Win 7 64bit.
The code is this:
=============BEGIN
var path = Context.GetState("OutputFolder");
if (path.charAt(path.length-1) != "\\")
path += "\\";
var separators = Configuration.separators+".";
// obtain .ico filename
var basename = Document.Name;
for (var i = 0; i < basename.length; ++i)
{
var stop = false;
for (var j = 0; !stop && j < separators.length; ++j)
stop = basename.charAt(i) == separators.charAt(j);
if (stop)
{
basename = basename.substring(0, i);
break;
}
}
// open the previous icon or create a new icon
var prev = Application.OpenDocument(path+basename+".ico");
var prevIcon = null;
if (prev) prevIcon = prev.Icon;
if (prevIcon == null)
{
var newIco = Application.CreateWizard("1EA02660-391E-484F-B1E0-3154F28C28BD");
newIco.Type = 0; // no initial images
prev = Application.CreateDocument(newIco);
prevIcon = prev.Icon;
}
if (Document.SupportsFeature("RasterImage"))
{
var image = Document.RasterImage;
if (image.SizeX > 256 || image.SizeY > 256)
{
Context.ErrorMessage = "Invalid image size";
Context.StopProcessing(false);
}
var newFormat = prevIcon.CreateFormatID(image.SizeX, image.SizeY, 32);
prevIcon.InsertImage(newFormat);
var newImage = prevIcon.GetImage(newFormat);
Blender.Compose(newImage, 0, 0, image.SizeX, image.SizeY, image, 0, 0, 0, Blender.OpSrc);
}
if (Document.SupportsFeature("Icon"))
{
var icon = Document.Icon;
var formats = icon.FormatIDs;
for (var i = 0; i < formats.length; ++i)
{
var format = formats[i];
prevIcon.InsertImage(format);
var newImage = prevIcon.GetImage(format);
var image = icon.GetImage(format);
Blender.Compose(newImage, 0, 0, format.SizeX, format.SizeY, image, 0, 0, 0, Blender.OpSrc);
}
}
prev.SaveCopyAs(path+basename+".ico");
===================END