Hi There,
I've had a look through the JS Ref but as yet haven't found what I'm looking for.
I'm trying to get text, highlighted using the 'Select Tool', into a variable so I can search for it on a page.
Please can someone tell me if it's possible?
I've been trying to use 'app.execMenuItem("Copy");' however this doesn't feel like the best method.
If someone could point me in the right direction it would be appreciated.
Thanks in advance.
Regards,
Nick
But it won't work because the "Paste" menu item is restricted in Acrobat 8 and later. It cannot be called from a script.
There are some much more complex approaches, for example using the highlight annotation to do the text selection and then finding the text under the annotations rectangle.
But it's so much simpler to just ask the user to enter the text into the search window.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script