left menu mob button

New Video on YouTube:


Comments

Jeanette Ashman
(09.11.2021 16:37):

Hi! I have several documents that use the same paragraph styles. I have all the files in a book so if I change something I can synchronies. But in the heat of the moment I sometimes make changes in one of the documents and forgets to synchronize. So... I am looking for a script where I can compare paragraph styles from different files (same name on paragraph style) and only see the difference between them. Do you know if there is something like that existing? Kind regards Jeanette

(Compare Styles)

hadi
(10.08.2021 9:44):

Hi. If there is a group style, its subset style will not be displayed.

(Copy GREP Styles)

hadi
(24.06.2021 9:04):

hi. It is a perfect script.

(Common Formatting of Several Tables)

Only The Necessary Information

(series of articles):

Localized Menu: the Adventure Continues

The problem of accessing scripts from the context menu of different localizations was described in detail in the article "Access to the script from a localized menu" and specified a year later. The solution methods proposed in those materials, to put it mildly, are far from perfect: it is suggested to manually search for the index of the desired menu and specify it in the script. It is clear that with this approach, in the case of moving the script to another computer, on which another version of the program is installed, with a different localization and a set of updates, the user will have to redo the index search and correct the script each time.

When the topic was again touched upon on the RuDTP forum in one of the discussions recently, Vitaly Batushev, the author of various scripts, one of them is “sZam”, which is known to many users, shared his decision:

Menu localization-2

Searching for objects by using a loop is not the fastest way, and, according to Vitaly, "unfortunately it is very slow". However, it allows you to solve the existing problem at once for all versions and localizations of InDesign.

Below is one of the examples of how to search for the index of the desired menu, both the context menu and the main one, regardless of the version and localization. It should be borne in mind that behind one or another index may not at all be "hiding" what we assume. For example, the object from the main menu "Table" that is needed in this case will contain the line: "$ID/Table,$ID/kTablePanelTitle,$ID/kPreflightOD_Table,$ID/XML_TableName". And when trying to get the context menu "$ID/RtMouseTable", for example the "$ID/RtMouseTableStrokeWidget" may interfere. The code below is made taking into account these peculiarities.

var menuName = "New table menu item";
var myMenuItem = app.scriptMenuActions.add(menuName);
myMenuItem.addEventListener('onInvoke', function(){main();});
function getCurMenu(m, mn){ //The object we need is in the collection of objects m and is called mn
	var mi = 0;
	var s = app.findKeyStrings(m[mi].name).toString();
	while (!(s.match(mn))){
		mi++;
		s = app.findKeyStrings(m[mi].name).toString();
		}
	return mi; //Return found menu index
	}
var mnu = app.menus[0].submenus[getCurMenu(app.menus[0].submenus, "kTablePanelTitle")]; //Top menu
var rMouseMnu = app.menus[getCurMenu(app.menus, "RtMouseTable$")]; //Context menu
mnu.menuItems.add(myMenuItem);
rMouseMnu.menuSeparators.add();
rMouseMnu.menuItems.add(myMenuItem);

With this algorithm, in order to embed the script into the menu, it is sufficient to pick once a regular expression (lines 13, 14) for the string s.match(mn) at line 7, where s is the full name of the current menu item (as in the examples above), mn is the string composed in a way that it can be contained in the name of just the desired menu.

The scripts on this site, which get embedded in various menus, have now all been updated. If you downloaded them before, and the attempt to embed them in the menu was not successful, download the new versions, try again and, if possible, let us know about the results in the comments.


Scripts available on the site, which are embedded in various menus:

No comments.