Last week, most downloaded:
The script "Compare Paragraph Styles" has been updated to version 3.0. Now, it allows you to compare properties of styles of any type (paragraph, character, object, table styles). Because of this, the script is now simply called: "Compare Styles". Also the user interface has been fixed: now it looks and works correctly in the CC versions.
How to access the list of styles through the ScriptUI? The subscribers (and just the viewers) of the "Scripts for Adobe InDesign" channel probably didn’t miss the release of a series of videos on the topic stated in the title of this article. Here, in the article itself, the code from the video is provided with links to those videos, in which you can find the explanation for this code.
Here, it should only be noted that the main feature of the algorithm is its versatility. With the help of the algorithm, you can easily and quickly get a list of styles of any type — the paragraph, character, table, or object styles. It is sufficient to replace the word "paragraph" in the second line of the first code fragment with the required type: "character", "table", "cell", "object", and the script will create a complete list of styles of the specified type (including the style groups) for the user window.
But how does one change the code so that the user himself chooses the type of styles he needs? A link to the corresponding video can be found at the end of the article.
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.