Posted by: Padanges
« on: September 06, 2016, 06:47:09 AM »"It's an optional parameter which defines where to start the search". Thanks.
Could you please clarify why do we use the keyword start here? The method prototype works just fine without that too.Not quite sure what you are asking here.
if (!Array.indexOf) {
Array.prototype.indexOf = function (obj, start) {
for (var i = (start || 0); i < this.length; i++) {
if (this[i] == obj) {
return i;
}
}
return -1;
}
}
Q1: How can I do a export of keywords with present version already today?You can use the File>ExportGridFields tool to export the keywords column to an external .csv or .txt file.
/*****************
Helper prototype methods
*****************/
if (!Array.indexOf) {
Array.prototype.indexOf = function (obj, start) {
for (var i = (start || 0); i < this.length; i++) {
if (this[i] == obj) {
return i;
}
}
return -1;
}
}
String.prototype.trim = function() {
var str = this.replace(/^\s\s*/, ''),
ws = /\s/,
i = str.length;
while (ws.test(str.charAt(--i)));
return str.slice(0, i + 1);
}
Array.prototype.uniqueMerge = function( a ) {
for ( var i = 0, l = a.length; i<l; ++i ) {
var s=a[i].replace(/['"]/g,'').trim();
if (s && this.indexOf( s ) === -1 ) {
this.push( s );
}
}
return this
};
/*****************
code starts here
****************/
var fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.OpenTextFile(WScript.Arguments.Item(0), 1);
var keywordsList=new Array;
while (!f.AtEndOfStream) {
var keywords=f.ReadLine().split(/,|;/);
keywordsList=keywordsList.uniqueMerge(keywords);
}
keywordsList=keywordsList.sort();
WScript.echo(keywordsList.join('; '))
Just save this code to a BuildKeywordsList.js file, and drag-drop on it the PDFE exported keywords column file. It will show you a popup with the sorted list of all your PDFs keywords.Q2: What is your opinion if such an export is worth considering ? And if yes, what are your plans?The next to release PDFE version has a scripting tool, so custom scripting this kind of tasks will be quite easy.
Q3: Do you know other software permitting an export of keywords after scanning pdf´s?No