Update folder with pdf files by dialog, but selection should be remembered
Hello,
Here below you find a script. If you run that script on a single file, you are able to tag a pdf file in the metadata field Author (file>properties).
Problem now is: I have 1000 pdf files, when I run the script and choose a "watched folder" and I proceed, then the first pdf will be tagged. After tagging the first file, I need to re set my checkmark again! This I would like to tackle. The script should have to save the selection in his memory during the whole script procedure, so that you have to set the checkmark once instead of 1000 times.
Once the script is done, the variable/memory of Acrobat should also be cleaned, because if I restart the script and I have to make another selection, this checkmark should then be used.
I hope somebody can help this newbie....
Kind regards
var dialog2 =
{
initialize: function(dialog) {
// Set a default value for checkbox field
dialog.load({"ckb1": true });
},
commit: function(dialog) {
// When the user presses "Ok", this handler will execute first
var results = dialog.store();
var tickedItems = [];
if (results["ckb1"])
tickedItems.push("Installation manuals");
if (results["ckb2"])
tickedItems.push("Operation manuals");
if (results["ckb3"])
tickedItems.push("Installer reference guide");
if (results["ckb4"])
tickedItems.push("User reference guide");
if (results["ckb5"])
tickedItems.push("General safety precautions");
if (results["ckb6"])
tickedItems.push("Declaration of Conformity");
if (results["ckb7"])
tickedItems.push("Option handbooks");
this.results = tickedItems.join(";");
},
// The dialog box description
description:
{
name: "Check/uncheck the checkboxes to tag your pdf file(s) in the file properties.",
elements:
[
{
type: "view",
align_children: "align_left",
elements:
[
{
type: "static_text",
name: "Check/uncheck the checkboxes to tag your pdf file(s) in the file properties. Multi selection is also possible.",
bold: true,
font: "dialog",
char_width: 30,
height: 20
},
{
type: "check_box",
item_id: "ckb1",
name: "Installation manuals"
},
{
type: "check_box",
item_id: "ckb2",
name: "Operation manuals"
},
{
type: "check_box",
item_id: "ckb3",
name: "Installer reference guide"
},
{
type: "check_box",
item_id: "ckb4",
name: "User reference guide"
},
{
type: "check_box",
item_id: "ckb5",
name: "General safety precautions"
},
{
type: "check_box",
item_id: "ckb6",
name: "Declaration of Conformity"
},
{
type: "check_box",
item_id: "ckb7",
name: "Option handbooks"
},
]
},
{
type: "gap", //Add a small vertical gap between
height: 10 //check boxes and buttons
},
{
type: "ok_cancel",
ok_name: "Ok",
cancel_name: "Cancel"
}
]
}
};
this.info.author=""
if ("ok"==app.execDialog(dialog2)){
this.info.title=dialog2.results
};
