Hello All,
I am hoping someone can help me with this. I am creating a script that searches for course codes and then creates a link to the registration page for each code found on a pdf document. The links are dynamic so I am passing the links in a string variable to the getURL method as follows.
if ( ckWord == CourseCode[k])
{
console.println(ckWord);
var urlstring = URLArray[k].toString();
var q = this.getPageNthWordQuads(p, i);
// Convert quads in default user space to rotated
// User space used by Links.
m = (new Matrix2D).fromRotated(this,p);
mInv = m.invert()
r = mInv.transform(q)
r=r.toString()
r = r.split(",");
l = addLink(p, [r[4], r[5], r[2], r[3]]);
l.borderColor = color.red;
l.borderWidth = 1;
l.setAction("this.getURL(urlstring)");
}
My problem is that the url is showing up with the local path in front of it. For example, it appears as f:\\|C:\...\http:\\wwww... etc. If I type the url into the getURL method it works just fine. Can someone please help guide me in passing dynamic links.
Thank you,
Thusi
Secondly, there's an error in your code. If you want to use the value of urlstring, then you need to use it like this:
l.setAction("app.launchURL(\"" + urlstring + "\")");
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com