Copy link to clipboard
Copied
Scenario: I have button and I assigned some actions to it using the add button from action tab, e.g., first action "Go To A Page View" and second action "Execute A Menu Item".
Is there an easy way to convert/export these actions as Javascript to use it somewhere else or tweak it?
I know I can write the javascript from scratch, but would be nice to use this as a way for fast javascript built.
Thank you
Copy link to clipboard
Copied
No, there's no easy way. The things you can do in some actions can also be done in JavaScript, but you'd have to study it and write the code. Many other actions do things impossible in JavaScript.
Copy link to clipboard
Copied
Actually, it's not that difficult to do... But it depends on what you want to achieve, exactly.
Do you just want to jump to a page, or do you want to show an exact point on it? And what menu item do you want to execute?
Copy link to clipboard
Copied
Mostly it was general question.
But for now. I have pdf portfolio with several pdf files.
For the "Go To A Page View" I want to jump from opened pdf back to portfolio. When set it shows Go to a page in another document, File: Parent document, Page: 1, Zoom level: Fit Width. So far I have not figured out the javascript for this.
For the "Execute A Menu Item" it is View>Portfolio>Cover Sheet. This is easy to change to javascript app.execMenuItem("CollectionShowRoot");
Thank you.
Copy link to clipboard
Copied
I'm not sure this kind of action is going to be possible. You can always try closing the file, though. That might take you back to the parent Portfolio file.
Copy link to clipboard
Copied
The problem with file closing is that the Cover page is not automatically displayed. So extra clicks are necessary from the menu. Also it is not very user friendly for people not familiar with portfolios.
I tried to add document level script as above for Document Will Close, but it does not work which make sence because in document view the portfolio menu is not available and the script is executed before close and not after close.
Copy link to clipboard
Copied
For what I need this script works. It extracts the name of the parent file.
var nm = path.split("/").pop();
nm = nm.substring(0, nm.indexOf("|"));
app.openDoc(nm);
app.execMenuItem("CollectionShowRoot");