Skip to main content
Participant
January 20, 2021
Question

Is it possible to convert the actions to javascript code?

  • January 20, 2021
  • 2 replies
  • 596 views

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

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
January 20, 2021

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?

macejdAuthor
Participant
January 21, 2021

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.

 

try67
Community Expert
Community Expert
January 21, 2021

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.

Legend
January 20, 2021

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.