Using the keyboard service keys (Shift, Ctrl, Alt) allows one to get several variations of the same operation with just one ScriptUI button. For example, when applying a paragraph style, a “simple” click on the respective ScriptUI button will apply the style "Heading-1", but the same click when holding down the Shift key will apply the style "Heading-2". If you also hold down the Alt key at the same time, the character styles in the current paragraph will be removed in addition to the above actions...
Watch how to implement all this abundance of functionality, using the “hot keys”, in the sixth part of the video tutorials on the ScriptUI.
The previous video still was not the final one on the topic of working with styles through the user interface. We still need to clean up the code, placing its lines where they belong, and, what I promised in the last video, as it were in passing — to bring ergonomics in the user window — we also need to show how to do it easily and quickly. Watch the video on the website, or on the YouTube channel.
In the final, third, video of the "style" topic, a function is shown for collecting user-selected styles into an array and transferring them to the main functionality of the program.
In the second video of the fifth topic on the Script UI, we’ll write the style selection interface itself and the function that collects the list of styles for this interface. This is the main part of the topic of working with styles through the Script UI.
Another (fifth) topic in the series about the Script UI introduces one of the ways to access the list of styles. One algorithm is responsible for forming the list, regardless of what type of styles the user needs — the paragraph, character, table or object styles. There is also one versatile function that handles the selected styles. The user just needs to indicate the type of required styles at the beginning of work.
The first series of the topic will acquaint some users with (or remind others of) the app.doScript(); construction, which will help to further implement the necessary versatility and independence from the user-selected type of styles.
You can watch the video on the website, or on the YouTube channel.
The fourth part of the video on the user interface gives an introduction to using the scrollbar for an array of interface elements. An example is taken from the book by Peter Kahrel and brought to a working state for any parameters, not just those shown in the book.