I need to duplicate an HTML Email with SSJS but in order to do that, firstly, I should get the content of the Email I want. I have written the code below but it doesn't work. The strange thing is the same code works for Data Extensions when I change ObjectType.
<script runat="server">
Platform.Load("core", "1");
var rr = Platform.Function.CreateObject("RetrieveRequest");
Platform.Function.SetObjectProperty(rr, "ObjectType", "Email");
Platform.Function.AddObjectArrayItem(rr, "Properties", "Name");
Platform.Function.AddObjectArrayItem(rr, "Properties", "ID");
Platform.Function.AddObjectArrayItem(rr, "Properties", "CustomerKey");
var sfp = Platform.Function.CreateObject("SimpleFilterPart");
Platform.Function.SetObjectProperty(sfp, "Property", "CustomerKey");
Platform.Function.SetObjectProperty(sfp, "SimpleOperator", "Equals");
Platform.Function.AddObjectArrayItem(sfp, "Value", "asgdsgsgsgsdgsg");
Platform.Function.SetObjectProperty(rr, "Filter", sfp);
var StatusAndRequestID = [0,0];
var Result = Platform.Function.InvokeRetrieve(rr,StatusAndRequestID);
if(Result != null) {
Write("It works");}
else { Write("It doesn't work");}
</script>