Hi all,
Here is the script :
Olav, I put the script in this folder on my Windows Xp at the office.
C:\Program Files\Fichiers communs\Adobe\Startup Scripts CS3\Adobe InDesign\
At home I have a Mac and tried to place the script in the startup scripts folder located in the Indesign main folder's subfolders (Export as Xhtml...).
On the mac, I am not prompted but the script only work a few then do nothing more.
#targetengine "session"
logfiles();
function logfiles()
{
var myApplicationEventListener = app.eventListeners.add("afterOpen",myEventInfo, false);
}
function myEventInfo(myevent)
{
var apppath = app.filePath;
var doc = app.documents[0];
//myevent.parent;
//app.documents[-1];
//app.open(File(myevent.parent.fullName));
//Try all these options without any changes
var filename = doc.name;
var filepath = doc.fullName;
var mydate = new Date;
var myday= mydate.getDate();
var mymonthlst = ["Janvier", "Fevrier", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Decembre"]
var mymonth = mymonthlst[mydate.getMonth()];
var myyear = mydate.getFullYear();
if(myday>15)
{
var monthsdaysnb = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var M = monthsdaysnb[0];
var D ="16-"+M;
}
else
{
var D = "1-15";
}
var mylogsfolderpath=apppath+"/logsfolder";
var logsfolder = new Folder(mylogsfolderpath)
logsfolder.create();
var mylogfile = logsfolder +"/fileslog_"+D+"_"+mymonth+"_"+myyear+".txt";
if(File(mylogfile).exists==false)
{
var fileslog = new File(mylogfile);
}
else
{
var fileslog = File(mylogfile);
}
fileslog.open("r");
var fileslogcontent = fileslog.read();
if(fileslogcontent.indexOf(filename)==-1)
{
fileslog.open("e");
fileslog.seek(0,2);
fileslog.writeln (filename+"\r"+filepath);
fileslog.close();
}
}
Hope you can bring me the light :-)
thx a lot in advance
Loic