Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

This worked just fine in Acrobat Pro 9 but doesn't work in X. What gives?

$
0
0

I hate Acrobat X.  I am getting stupid errors and am missing all sorts of metadata functionality.  I can't even browse (nevermind edit) metadata in Explorer, and see no solution for it anywhere on the net.

 

I used this javascript in Acrobat 9 with NO PROBLEMS.  In Acrobat X  I get Syntax error missing ( before condition 8: on row 9 and can't proceed.  So what is different about Javascript in 9 that changed in X, and where do I find these changes?

 

 

/* Filename to metadata (title, author) */

var fname = this.documentFileName;

var deliminator = " - "

var lookfor = fname.lastIndexOf(deliminator);

 

// Splice components

 

if lookfor = -1

{

var string1 = fname.slice(lookfor + deliminator.length, fname.length).replace(/.pdf/gi, "")

}

else

{

var string1 = fname.slice(fname, lookfor)

var string2 = fname.slice(lookfor + deliminator.length, fname.length).replace(/.pdf/gi, "")

}

// Insert values

this.info.Title = string1

this.info.Author = string2


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>