Copy link to clipboard
Copied
Our office has multiple users who often work on the same InDesign files at various times. We are trying to figure out a way to create a footer, variable text box, or something that we can place in our InDesign documents, that will identify the Mac user/ InDesign username of the person who last saved the file. I've played around with various scripts and finally found one that will at least add a variable text option (which we then added to a text box) for the InDesign username.... however, the username did not automatically update when the file was opened by another user, even when he had the same script installed on his computer.
Please note: I am very new to scripting, and have only attempted to learn it to resolve this specific issue. (I have, however, spent the last few days researching this and trying to find a solution.)
Hi Kellewisphoto,
you can get the name of the logged-in user with:
// On Windows:
$.getenv("USERNAME")
//On Mac OS X:
$.getenv("USER")
and then, if you like, set InDesign's app.userName value to its result.
Note: If you trash InDesign's preferences or cache ( I did not try this ) the value of userName is set back to its default string "$ID/Unknown User Name".
Regards,
Uwe Laubender
( ACP )
You can do this using this startup script:
#targetengine "Kasyan"
var eventListener = app.addEventListener("beforeSave", rememberLastUser, false);
function rememberLastUser(event) {
try {
var doc = event.parent;
doc.metadataPreferences.author = app.userName;
}
catch(err) {}
}
It inserts the user's name into the author field before the document is saved.
User name
File info dialog box
Also, the name goes to an exported PDF file
Of course, you can use another field in metadata.
Hope it help
...Copy link to clipboard
Copied
Hello Kellewisphoto,
Can you please post the script your testing\modifying, also what OS are all the users on....Mac based?.....PC based?
Regards,
Mike
Copy link to clipboard
Copied
Mike,
I haven't even found a script that I'm able to modify yet. (Very much a beginner in scripting.) I'm tinkering with Applescript and all of the ones I've downloaded so far are... well, not Apple. We're all using Macs here.
This is vastly out of my realm of expertise, but I'm trying to creatively problem-solve, and maybe learn something new while I'm at it.
Copy link to clipboard
Copied
Mike means the script that you are using now – the one that doesn't work. Maybe we can figure out why it doesn't if you show it.
Copy link to clipboard
Copied
Sorry if this is a lot of unnecessary stuff, but below is the first script we had tried (the one that doesn't update when my colleague opens the file from his Mac). It's also from 2012 so I'm aware that could be part of the problem.
Copy link to clipboard
Copied
Hi Kellewisphoto,
by default, after installing InDesign, app.userName is a string like that ( from my German InDesign ) :
"Unbekannter Benutzername"
This is equal to: "$ID/Unknown User Name".
This user name usually is not equal to the user name a user is logged-in to the computer.
I cannot see that InDesign is storing the computer's user name to a document.
So you cannot trace an InDesign document back to its creator, the logged-in user.
Did every of your InDesign users define the InDesign user name?
Menu: File > User…
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Hi Kellewisphoto,
you can get the name of the logged-in user with:
// On Windows:
$.getenv("USERNAME")
//On Mac OS X:
$.getenv("USER")
and then, if you like, set InDesign's app.userName value to its result.
Note: If you trash InDesign's preferences or cache ( I did not try this ) the value of userName is set back to its default string "$ID/Unknown User Name".
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
You can do this using this startup script:
#targetengine "Kasyan"
var eventListener = app.addEventListener("beforeSave", rememberLastUser, false);
function rememberLastUser(event) {
try {
var doc = event.parent;
doc.metadataPreferences.author = app.userName;
}
catch(err) {}
}
It inserts the user's name into the author field before the document is saved.
User name
File info dialog box
Also, the name goes to an exported PDF file
Of course, you can use another field in metadata.
Hope it helps.
— Kas
Copy link to clipboard
Copied
Hi. I know you've found a solution, but another route would be to have an intermediary check-in/check-out system for users based in, say, a Filemaker or other database. Filemaker is quite scriptable and comes with networking built-in. The meta info could be inserted from Filemaker, and/or Filemaker could also keep the info so that anyone on the network could see who worked on which documents at what time, keep statistics, time worked, etc.
Copy link to clipboard
Copied
I appreciate this advice. However, this is a small company and I think they prefer we don't purchase additional software unless it's completely necessary. I will definitely do some research on Filemaker and keep it in mind for the future, in case our scripting endeavors don't fix the issues.
Everyone's help is very much appreciated.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now