Copy link to clipboard
Copied
Hi
this.pane = 'Bookmark'; will open the bookmark panel on the open document, however it does not set the initial view navigation tab setting.
So when the document is closed (after saving) it still won't set the document to open with the bookmark tab open.
Is there a way (execMenuItem and messing with the registry?) to do this.
Thanks
Trevor
Would be good to know for both Windows and Mac
Copy link to clipboard
Copied
Just embed the code at the document-level. Or better yet, simply set the Initial View setting (under File - Properties) to show the Bookmarks panel.
Copy link to clipboard
Copied
Hi Try
Thanks for your answer.
Can you give a little snippet for what you mean of embedding the code in the document level?
Do you mean including the script in the document so it will run when the document is opened?
If that's the case then the 'opener' will need to have his js set to run which is not necessarily so.
Need to do this with JS and not the UI so unless I misunderstood your second options not god for me.
Regards
Trevor
Copy link to clipboard
Copied
I can explain, but why do you want to do it using JS instead of the built-in option?
Copy link to clipboard
Copied
Because I want to automate it.
The basic Idea is to automate exporting a document from InDesign into a PDF and sending it as an email.
This can be achieved by running the jsx script from InDesign and have the jsx script use vsb or applescript to communicate with the other applications, like outlook and acrobat. Acrobat and outlook (not really needed as one can send strait from acrobat) would ideally do their stuff with hidden windows and no user interaction. The requirement is that the bookmarks panel should be defaulted to open.
In summary press some script shortcut key from InDesign and the boss / client has the PDF document in the way he wants it.
Copy link to clipboard
Copied
You should check the settings of ID if it's not possible to set the Initial View there... If not, you can execute this code:
this.addScript("load", "this.pane = 'Bookmark';");
Copy link to clipboard
Copied
This is a good start but it is a problem that the js has be set to enabled on the openers end.
Because I am trying to save it from outside of Acrobat using AForm.Fields.ExecuteThisJavaScript I get the following bug when trying to save
' NotAllowedError: Security settings prevent access to this property or method.
Doc.saveAs:1:External undefined:Exec'
I can probably get around that by saving the doc with 'pure vbs'
I would be happy to hear if there's any more solid way avoiding the script embedding and the changing the security settings.
Can one change the security settings to avoid the saveAs problem?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I'm not sure what I'm supposed to see there... I gave you the code to use to achieve what you wanted.
Copy link to clipboard
Copied
I tried this code (saved it to the pdf document javascripts) but it doesn't open the bookmarks panel when you close the doc then reopen it.
Is there a way of saving this setting without physically doing it the "built-in way"?
Copy link to clipboard
Copied
To see it work you have to close Acrobat and reopen it (I think) the debugger should be closed
My not fully working vbs is
Set App = CreateObject("Acroexch.app")
app.show
Set AForm = CreateObject("AFormAut.App")
acrobatJsScript = "var doc = app.openDoc({cPath: 'C:\\Users\\Trevor\\Desktop\\Test\\test2.pdf'});this.addScript('load', 'this.pane = \'Bookmark\'');this.saveAs({cPath: 'C:\\Users\\Trevor\\Desktop\\Test\\test2.pdf'});"
AForm.Fields.ExecuteThisJavaScript acrobatJsScript
I'm going out now so I won't give any quick response.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now