Hello Forum,
sometimes I´ve much files opened in Acrobat, so edit this files e.g. with Pitstop. It would be nice to save all the opened Files in Acrobat with closing them in one Folderscript. I made this two FolderScripts for saving and closing the files, but only one file is saved and/or closed by the time. I made some experience found in the forum:
1 first Folder sript for saving the files(It saves only one File):
var ProcessDocument1d = app.trustedFunction(function()
{
app.beginPriv();
// Build path root from current document.
// Split off the ".pdf" at the end (this is just one way it can be done)
var aPth = this.path.split(".");
aPth.pop();
var cPathRoot = aPth.join(".");
// Now run the extraction loop
for ( var i = 0; i < this.numPages; i++ )
this.saveAs({
nStart: i,
cPath: ""+this.path+""});
this.closeDoc(true);
}
)
app.endPriv();
//add the menu item
app.addMenuItem({
cName: "DoppelSeitenZuEinzelSeitenJS", // this is the internal name used for this menu item
cUser: "Alle in Acrobat geoeffneten Dokumente Speichern",// this is the label that is used to display the menu item
cParent: "WeitereTools", // this is the parent menu. The file menu would use "File"
cExec: "ProcessDocument1d()",// this is the JavaScript code to execute when this menu item is selected
cEnable: "event.rc = (event.target != null);", // when should this menu item be active?
nPos: 1
});
2 second Folderscript to close all opened Files in Acrobat:
var ProcessDocument1c = app.trustedFunction(function()
{
app.beginPriv();
// Build path root from current document.
// Split off the ".pdf" at the end (this is just one way it can be done)
var aPth = this.path.split(".");
aPth.pop();
var cPathRoot = aPth.join(".");
// Now run the extraction loop
for ( var i = 0; i < this.numPages; i++ )
this.saveAs({
nStart: i,
cPath: ""+this.path+""});
for(var i=app.activeDocs.length-1; i>=0; i--)
{
if(app.activeDocs[i]!=this)
app.activeDocs[i].closeDoc(true);
}
}
)
app.endPriv();
// add the menu item
app.addMenuItem({
cName: "DoppelSeitenZuEinzelSeitenJS", // this is the internal name used for this menu item
cUser: "Alle in Acrobat geoeffneten Dokumente Schliessen", // this is the label that is used to display the menu item
cParent: "WeitereTools", // this is the parent menu. The file menu would use "File"
cExec: "ProcessDocument1c()",// this is the JavaScript code to execute when this menu item is selected
cEnable: "event.rc = (event.target != null);", // when should this menu item be active?
nPos: 1
});
I tried to combine both FolderScripts, but I can´t get in run all opened Files saving AND closing.
Thank you very much for your help and have all a nice Weekend
kind regards
Gebhard
thank you for deleting the "Spam" :-)
kind regards
Gebhard