INDESIGN CS - username in text box

Hello All!

Does anyone know how to create script that would do this:

Search for text box name : “USERNAME”
replace text with new text: “Printed by : Joe Smith”
Name this box “USERNAME”
end

What I am trying to accomlish is to have a text box on top of page, and each time I run this script it will write designers name (whoever is working on it) in that box. I have something similar for date and time , but I cant figure it out…

THANKS

yes this is an old post - but in case anyone’s looking…

I would apply a script label to the text box that you want to contain the username to something like “username”

then in applescript:

tell application "System Events"
	set theUser to full name of current user as string
end tell

tell application "Adobe InDesign CS2"
	tell active document
		set contents of every text frame whose label is "USERNAME" to theUser
	end tell
end tell