PDF-ShellTools > General

Run MyScripts via Command Line/DLL & delete original files

(1/1)

robg:
Hi, 2 questions:

1. I've written quite a complex script with the context menu scripts editor, which it works great, but I would really like to invoke this from the command line interface.
Is it possible to run my custom scripts from Command Line/DLL?

2. In my script I'm creating a new merged file. How can I get it to delete the original files when I'm done with them? At the moment I get a file permissions error.

Thanks!

Rob

RTT:

--- Quote ---1. I've written quite a complex script with the context menu scripts editor, which it works great, but I would really like to invoke this from the command line interface.
Is it possible to run my custom scripts from Command Line/DLL?

--- End quote ---
Something that needs to be developed. I will try to add it to the next release.

--- Quote ---2. In my script I'm creating a new merged file. How can I get it to delete the original files when I'm done with them? At the moment I get a file permissions error.

--- End quote ---
The MergeDocument function keeps the document open and only releases it after a new document is merged or the EndAndSaveTo function is called. If you are merging documents in a loop, you may use this strategy.

--- Code: ---for (){
...
Merger.MergeDocument(Filename);
if (prevFilename) DeleteFile(prevFilename);
prevFilename = Filename;
....
}
Merger.EndAndSaveTo(NewFilename);
if (prevFilename) DeleteFile(prevFilename);
--- End code ---

Or you can just keep a list of the documents to delete and do it after you are done with the merger.

robg:

--- Quote ---Or you can just keep a list of the documents to delete and do it after you are done with the merger.

--- End quote ---

Thanks - I went with this option.

Navigation

[0] Message Index

Go to full version