aep project file and fileObj.copy(target) - need help

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
BigMacGyver
Posts: 19
Joined: May 7th, 2013, 6:43 am

Hello,

i am trying to do a rather simple and straight forward operation: I want a script to copy my after effects project file to another, empty location. i am using copy() for this as following:

Code: Select all


var target = new File(['/Macintosh HD/Users/User25/Desktop/project.aep'])
var thisFile = new File (['/Macintosh HD/Users/User25/Desktop/ProjectSub/project.aep']);
var copy = thisFile.copy(target);
Now i am lost because the resulting file is not an after effects .aep project file, but an MXML file containing weird code. If i try the above code for a .mov file, it will correctly create a copy of that .mov file but every time i try an after effects project file it returns this weird MXML, no matter how i change path names or project names.

Can somebody solve this mystery, please?
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

I just tried your code, modifying just the file paths for my setup and it worked exactly as expected. It create a new, working copy of the AE project.

What version of AE are you using? Does it do the same thing if you run it from the ExtendScript Toolkit? Does it produce a file called "project.aep" but then AE gives some error when you try opening it? Is the project perhaps an AE XML project (i.e. .aepx) that has accidentally been renamed as a .aep?

Paul
BigMacGyver
Posts: 19
Joined: May 7th, 2013, 6:43 am

Hey Paul, thanks for helping out.

I am basically just running this code from the extend script toolkit. The AE version is cs 5.5 (10.5.0.253).

Just tested it again. There is no error when the mxml file is created. The file has a size of 10kb (which is equivalent to the .aep file that is supposed to be copied). Alerting the copy variable returns true, indicating a successful copying process. The mxml file has the same name as the original .aep file, even including the file extension. I am even able to open the file from after effects as a project file.
Yet, even though it has .aep at the end and i can open it with after effects, it is recognized by the operating system as an mxml file?? Might be more of an operating system error than it is an error of the javascript.

edit: i just figured that mac osx interprets the copied project file as one to open as adobe flash document per default any time i copy it with the script. I don't know why it does so though. It does not really make sense to me. Especially because other file formats remain with their default application to open after copying them (like the .movs i copied before). Furthermore, all other .aep files are still being opened by default with AE... just the copied .aep file is not. Weird.
Post Reply