Copy link to clipboard
Copied
Bonjour,
Je désespère de trouver une solution ...
J'ai 500 photos et 10 scripts.
Je voudrais appliquer a chaque photo un certain script.
Ex
Photo 1 = Script 2
Photo 2 = Script 6
Photo 3 = Script 3
Photo 4 = Script 1
Photo 5 = Script 10
Est il possible de le faire en créant un fichier txt pour lui indiquer les association a faire ?
Merci de votre aide
Copy link to clipboard
Copied
maybe so ?
var dir = "C:\\SomeFOLDER\\WorkingDir";
//or use single slash: var dir = "C:/SomeFOLDER/WorkingDir";
var scripts_dir = "C:\\SomeFOLDER\\YourScriptsFolder";
/////////////////////////////////////////////////////////////////////////////
function f(file_name, script_name)
{
try {
app.open(dir + "\\" + file_name);
var __doc = app.activeDocument;
$.evalFile(scripts_dir + "\\" + script_name);
__doc.close(SaveOptions.SAVECHANGES);
}
catch (e) { alert(e); }
}
/////////////////////////////////////////////////////////////////////////////
e("Photo 1.jpg", "Script 2" )
e("Photo 2.jpg", "Script 6" )
e("Photo 3.jpg", "Script 3" )
e("Photo 4.jpg", "Script 1" )
e("Photo 5.jpg", "Script 10")
// and so on...
// or put this lines into some file.txt and uncomment next line
// $.evalFile("file.txt");