Hi Reimund,
Just came across this post so I'm not sure if you've recieved an answer on this but here are my thoughts. If your only goal is to include the file, they can be used pretty well interchangeably. However, there are a few advantages to using $.evalFile() over //@include.
For one, you can make the call to evalFile conditional by wrapping it in an if statement. That way, you could set flags or test for a certain state within the app (# of layers, a certain named layer, etc.) before importing. With this, you can make your script that much more modular by potentially loading different scripts based upon different criteria as below.
if(parentLayerExists) {
$.evalFile("parentLayerScript.jsx");
} else {
$.evalFile("childLayerScript.jsx");
}
The 2nd advantage of evalFile is that it can be wrapped in a try/catch block and you can actually require the imported file to load without error. If the external script you load has errors and doesn't load, then later in the importing script...when you try and access the external scripts functionality, your script will fail. Although not necessary (since the ultimate outcome is a script that doesn't run), you can safe guard against this and have your script fail gracefully. It also means that whatever your script does to your PSD (or AE comp or AI file, whatever you're scripting in) doesn't half execute...leaving it in a tenuous state. And, safeguarding/failing gracefully is just a good programming practice.
try {
$.evalFile("scriptThatFails.jsx");
} catch(e) {
//Uh oh! The script we rely on didn't work, no need to continue;
//I could also alert the user that an error occurred or even what that error was.
alert("ERROR: "+e.message);
return false;
}
That might be more than you want/need to think about for your script...but hopefully that helps!