These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Open advanced search window with form button

tivofan
Registered: Nov 10 2011
Posts: 3
Answered

Hi all,
Forum newbie here, and javascript newbie too!
 
I am looking to set up a button on my PDF form that will launch the advanced search window when the file is viewed in AdobeReader.
 
Effectively what I am trying to do is to run some javascript from the button (which I know how to do) to send 'Ctrl'+'Shift'+'F' to open the window (which I dont know how to do) and allow the user to then enter their search terms and options.
 
Any help greatly appreciated.
Many thanks
TF

My Product Information:
Acrobat Pro 6.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The "search" is a menu option. So take a look at this article:
http://acrobatusers.com/tutorials/2008/06/executing_menu_items_from_javascript

In Acrobat 8 most menu items are restricted, this may or may not be one you can run from a non-privileged script. However, an advanced search can also be setup and run using the Search object.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

tivofan
Registered: Nov 10 2011
Posts: 3
Hi,
Thank-you for your quick and informative response!

I already have the form button successfully launching the 'Edit>Search' menu option but in AdobeReader this gives a small search field in the top right by default. Yes, the user can then use Ctrl+Shift+F to opem am advanced search in a new window, but if they are not AdobeReader savvy (as a lot of my clients aren't) then I was hoping I could bypass that manual step and open the advanced search window for them automatically by using a script on the form button.??Thanks again.
TF
tivofan
Registered: Nov 10 2011
Posts: 3
Accepted Answer
Thanks for all the help - if anyone else is interested after much digging, this does exactly what I wanted.
In the form button I run the following javascript when the button is clicked - in AdobeReader it opens the advanced search window as a pop-up - perfect!!

app.execMenuItem("FindSearch");

Hope this helps other users.
Cheers
TF