Reply to: How to Copy File in another folder in XmetalDecember 7, 2012 at 8:16 pm
We don't have any APIs for manipulating the file system.
The simplest option would be to use Microsoft's “File System Object” (FSO) to do this:
//XMetaL Script Language JScript:
var imagepath = "c:\images\myimage.jpg";
var newimagepath = "c:\test\myimage.jpg";
var fso = new ActiveXObject("Scripting.FileSystemObject");
fso = null;
See Microsoft's documentation for detailed information on all of the properties and methods the File System Object supports. Most examples they give will be in VB or VBScript so be aware of the differences between VB and JScript if your macro is in JScript.
Keep in mind that if you build a solution that moves files around it is possible that it will conflict with the CMS systems XMetaL Author integrates with. So you will want to specifically test that if your solution includes a CMS.