It would probably help if i showed you the actual Script. #targetengine "AutoStartScript" app.addEventListener( "beforeSave" , doTextFrameOnPageOne ); function doTextFrameOnPageOne() { // Name of the Text Frame The Save information is in. var frameName = "Save_Information"; var doc = app.documents[0]; var tempFrame = doc.textFrames.itemByName(frameName); //-------------------->This is the Part that i cannot get to work proper<---------------------\\ var contentsOfFrame = doc.name+"\r"+ getLogInUserName() +"\r"+ getLocaleDateString() +"\r"+ VariableTypes.CREATION_DATE_TYPE +"\r"+ // This is the first Problem VariableTypes.OUTPUT_DATE_TYPE+"\r"+ // This is the second Problem getAppUserName(); //--------------------> The "VariableTypes" <---------------------\\ // Change Properties of Text Frame.: var tempFrameProperties = { name : frameName , contents : contentsOfFrame , fillColor : "yellow50" , geometricBounds : ["-0.75in","-4.45in",".5in","-.75"] } if(!tempFrame.isValid) { var tempFrame = doc.pages[0].textFrames.add(); tempFrame.properties = tempFrameProperties; }; tempFrame.contents = contentsOfFrame; } function getLogInUserName() { // Computer User Name var userNameOSX = $.getenv("USER"); var userNameWindows = $.getenv("USERNAME"); if(userNameWindows == null){return userNameOSX} else{return userNameWindows}; } function getAppUserName() { return app.userName; } function getLocaleDateString() { return new Date().toLocaleString(); }
... View more