// Create Sample Flie in Document folder (a folder with one text file and a sub folder which also have a text file)
baseDir = "$DOCUMENTS";
dir = baseDir || "/" || Substitute( MDYHMS( Today() ), "/", "-", ":", "." );
Create Directory( dir );
theText = "Copy Test";
Save Text File( dir || "/0_Test Copy1.txt", theText );
dir2 = dir || "/" || Substitute( MDYHMS( Today() ), "/", "-", ":", "." );
Create Directory( dir2 );
Save Text File( dir2 || "/Test Copy2.txt", theText );
//Copy Sample Files
Wait( 1 );
CopyFilesList = Files In Directory( dir );
CopyPath= baseDir || "/" || Substitute( MDYHMS( Today() ), "/", "-", ":", "." );
//The error message appears when the copy target is a folder.
For( Count = 1, Count <= N Items( CopyFilesList ), Count++,
Copy File( dir || "/" || CopyFilesList[Count], CopyPath || "/" || CopyFilesList[Count] )
);
The error message occurs after running the example above. An error message appears when the copy target is a folder.