// enable double clicking from the Macintosh Finder or the Windows Explorer #target photoshop // If any documentes are open if (app.documents.length >=1) { // create a variable to get the current document name myDoc = app.activeDocument.name; } else { sampleDoc = "There are no documents open."; } //show the name of the current doc alert(myDoc); //Strip off the file type extension alert(myDoc.slice(0,-4)); //add on a new file type extension alert(myDoc.slice(0,-4)+".pdf");