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

Open Navigation attachment panel with Reader 7.0

patra
Registered: Oct 19 2006
Posts: 270

There is any way with a Script apply on a button to be able to open
Attachment navigation Panel.

Most of the users uses Reader 7.0.

I tried with a action Execute Menu>View>Navigation attachment panel
but does'nt work with Reader 7.0
I have create the form with Acrobat Pro 8.0

Thanks

My Product Information:
Reader 7.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The menu commands for displaying the navigation panels are really toggles. Select it once and the panel appears, select it again and it dissappears. There is no way from JS to know whether the panel is shown or hidden.

There are also other problems, in Acrobat 8 the menu items that can be run from a document are restricted with a list in the registry. Although I think the view navigation panels items are available, but I'm not sure.

And finally, there is the problem you are seeing, which is that the internal menu item name for the showing and hiding the Attachments Panel is different between Acrobat 8 and Acrobat 7.

But you could use a script to fix this problem:

if(app.viewerVersion >= 8)
app.execMenuItem("ShowHideFileAttachement");
else
app.execMenuItem("ShowHideAttachements");

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

jpjarosz
Registered: Oct 23 2008
Posts: 5
Great tip, thomp!

Just FYI, there was a typo in thomp's reply ("Attachements"). The following works for Acrobat version 9.1:

1) Advanced->Document Processing->Document JavaScripts
2) Type "ToggleAttachmentsPane", click Add
3) Delete this text:

function ToggleAttachmentsPane() { }

and replace with

if(app.viewerVersion >= 8)
app.execMenuItem("ShowHideFileAttachment");

Note that some menu actions will cause the document to get reloaded, and thus the attachments pane will toggle back off (for instance, if you go back a second time to Advanced->Document Processing->Document JavaScripts and close). But at least this will work for the common user of Acrobat Reader.
IMR
Registered: Mar 2 2006
Posts: 1
I am trying to use
if(app.viewerVersion >= 8)
app.execMenuItem("ShowHideFileAttachement");
else
app.execMenuItem("ShowHideAttachements");

but get
InvalidArgsError: Invalid arguments.
App.execMenuItem:2:Link undefined:Mouse Up

Can anyone help please?

ps I have no idea about what jpjarosz is saying! and how it effects the code I am trying to use?
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Things have changed since version 8. You can no longer call execMenuItem from a button directly.
It must be done through a trusted function, installed on the local machine.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com