I have tried using the below AMPscript block in an SSJS Activity, however it appears that Script activities only support SSJS and AMPscript cannot be included in Script Activities — please can someone clarify this?
<script runat="server">
Platform.Load("Core","1");
%%[
SET @action = "start"
SET @id = CreateObject("ImportDefinition")
SetObjectProperty(@id, "Name","Sonata Import")
SetObjectProperty(@id, "AllowErrors", "true")
SetObjectProperty(@id, "UpdateType", "Overwrite")
SET @de = CreateObject("DataExtension")
SetObjectProperty(@de, "CustomerKey", "InsertKeHere")
SetObjectProperty(@id, "DestinationObject", @de)
SetObjectProperty(@id, "FieldMappingType", "InferFromColumnHeadings")
SetObjectProperty(@id, "FileSpec", "example-min.xml")
SetObjectProperty(@id, "FileType", "Other")
SetObjectProperty(@id, "Delimiter", "~")
SET @ar = CreateObject("AsyncResponse")
SetObjectProperty(@ar, "ResponseType", "email")
SetObjectProperty(@ar, "ResponseAddress", "[email protected]")
SetObjectProperty(@id, "Notification", @ar)
SET @ftl = CreateObject("FileTransferLocation")
SetObjectProperty(@ftl, "CustomerKey", "Mercer Enhanced FTP")
SetObjectProperty(@id, "RetrieveFileTransferLocation", @ftl)
InvokePerform(@id, @action, @statusMessage)
]%%
<script runat="server">
</script>

