This content has been marked as final. Show 15 replies
Could you post the script here? Do you have any other startup scripts installed?
Where, exactly, are you putting the startup script?
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.
var myApplicationEventListener = app.eventListeners.add("afterOpen",myEventInfo, false);
var apppath = app.filePath;
var doc = app.documents;
//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();
var monthsdaysnb = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
var M = monthsdaysnb;
var D ="16-"+M;
var D = "1-15";
var logsfolder = new Folder(mylogsfolderpath)
var mylogfile = logsfolder +"/fileslog_"+D+"_"+mymonth+"_"+myyear+".txt";
var fileslog = new File(mylogfile);
var fileslog = File(mylogfile);
var fileslogcontent = fileslog.read();
Hope you can bring me the light :-)
thx a lot in advance
Hi Loic ,
I just put your script inside D:\Program Files\Adobe\Adobe InDesign CS3\Scripts\Startup Scripts folder on my PC and it seems to be working as expected.
Or you can put it into User folder:
C:\Documents and Settings\Kasyan\Application Data\Adobe\InDesign\Version 5.0\Scripts\Startup Scripts
Folders like C:\Program Files\Common Files\Adobe\Startup Scripts CS3\Adobe InDesign are intended for scripts installed by applications, not by users.
I tried what you offered me to do. It seems endless. I am really desperate now.
Now the script do not even work once and prompt immediatly for a error alert saying :
b the action couldn't be achieved because the object doesn't exist anymore.
(sorry for the language, it's frenglish)
It seems that this alert comes twice cause when I click ok, it prompt me once again.
I am still looking on my side and start thinking I won't ver get the magic key :-(
Thanks you for having considered the question.
I tested your script again, at my work this time, on Mac and PC, it works for me: creates logsfolder if it doesnt exist, creates file (e.g. fileslog_1-15_Septembre_2008.txt) and writes file name and path of opened file to it.
I was able to reproduce the exact error you have by putting the script into the wrong place (C:\Program Files\Common Files\Adobe\Startup Scripts CS3\Adobe InDesign).
I must have offended a egyptian sanctuary and so I am damned for eternity :-(
Thanks for your help anyway. At least I know it runs, except at my place.
Maybe rebooting the PC will trash some temp files that annoy me.
I stop bugging you so.
Thanks once again.
Please double-check the ExtendScript startup script directory for copies of your script--if you put it there, as Kasyan says (thanks, Kasyan!), you'll get exactly the error you report. Again, this is the WRONG place to put the script (where "~" is your drive):
~\Program Files\Common Files\Adobe\Startup Scripts CS3\Adobe InDesign
The RIGHT place to put the script is:
~\Program Files\Adobe\Adobe InDesign CS3\Scripts\Startup Scripts
Hi Kasyan & Olav,
Thanks a lot to you guys.
Kasyan, you ironically first make me feel depressed cause Icouldn't understand why I was like the only one that couldn't make it run properly. But in the same time, it was nice to know that the main part, the script, was working.
Olav, your last remark about ExtendScript startup script directory was a good hint. I digged on this way and finally reviewed the
Adobe InDesign CS3 Scripting Tutorial.pdf that precise the path :
i Mac OS: ~/Library/Preferences/Adobe InDesign/Version 5.0/Scripts
i Windows XP: ~\Documents and Settings\user_name\Application Data\Adobe\InDesign\Version 5.0\Scripts
i To run a specific script when InDesign starts, put the script inside a folder named Startup Scripts inside the Scripts folder (create this folder if it does not already exist).
So after placing my script there, it seems that the script on my mac at home runs well. I will check on my PC at the office but it shouldn't be a trouble any longer. I hope so.
I won't be at the office till Monday so I won't be able to give you a feedback for windows before but whatever happens I will keep you in touch.
Thanks you a lot. That was so frustrating. I was close to cry really.
PS: Olav, I think I was blinded by the fact that "Startup Scripts" folders already existed. I thought that it was the place to go. And there was my mistake.
Hi Olav & Kasyan,
I have bad news.
C:\Documents and Settings\Loic\Application Data\Adobe\InDesign\Version 5.0\Scripts\Startup Scripts\Raccourci vers write_files_log.jsx
So it's a difference between your home machine and your office machine. The first thing to suspect: permissions. Are you logged in as an Administrator on your work machine?
I will have a look tomorrow at the office and let you know.
I have a lot of files disseminated on many servers, could you think it could be the source of the issue ?
Thanks for your patience and understanding
I checked this morning and noticed I am on a administrator machine with all priviledges.
I don't know if it can help but :
var mytxtfile = new File("/c/Program Files/Adobe/Adobe InDesign CS3/logsfolder/toto.txt");
through ESTK works fine. The file is created. So I guess I can operate in this folder without restrictions.
Thanks for your care.
Hi Olav, Kasyan,
Just to close the book, it finally works on my office machine.
I don't know what happened special but after many attempts to make it run, it finaly started.
I have no explanation but I am glad to get it at end.
Thanks for all your time and efforts to help me.
It makes me glad to hear that it works at last, although the mystery still remains unsolved.