Adobe 65009333 Scripting Guide - Page 76
author = Adobe Systems, app.userName = Adobe
UPC - 883919155852
View all Adobe 65009333 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 76 highlights
Events A sample "afterNew" eventListener 76 #targetengine "session" //Creates an event listener that will run after a new document is created. main(); function main(){ var myEventListener = app.eventListeners.add("afterNew", myAfterNewHandler, false); } function myAfterNewHandler(myEvent){ var myDocument = myEvent.parent; main(myDocument); function main(myDocument){ app.userName = "Adobe"; myAddXMPData(myDocument); } function myAddXMPData(myDocument){ with(myDocument.metadataPreferences){ author = "Adobe Systems"; description = "This is a sample document with XMP metadata. Created:" + myEvent.timeStamp + "\rby: " + app.userName; } } }
Events
A sample “afterNew” eventListener
76
#targetengine "session"
//Creates an event listener that will run after a new document is created.
main();
function main(){
var myEventListener = app.eventListeners.add("afterNew",
myAfterNewHandler, false);
}
function myAfterNewHandler(myEvent){
var myDocument = myEvent.parent;
main(myDocument);
function main(myDocument){
app.userName = "Adobe";
myAddXMPData(myDocument);
}
function myAddXMPData(myDocument){
with(myDocument.metadataPreferences){
author = "Adobe Systems";
description = "This is a sample document with XMP metadata. Created:"
+ myEvent.timeStamp + "\rby: " + app.userName;
}
}
}