left menu mob button

New Video on YouTube:

It's such a shame to waste time. We always think we have so much of it. (Mitch Albom)


Danko Josic
(05.06.2020 1:08):

Thank you. Great help.

(Common Formatting of Several Tables)

(28.04.2020 20:50):

Это замечательно! Огромное спасибо за скрипт!!!

(Split Text By Paragraphs)

(25.04.2020 16:41):

Михаил, приветствую! Пример того, как создаются выпадающие списки стилей, можно посмотреть, например, в скрипте: eugenyus.rudtp.ru/ru/applyParStyleWithNextStyle Строки 3-19 - создание массивов, окна и выпадающего списка в этом окне; строка 30 - получение доступа к выбранному пользователем стилю после того, как была нажата кнопка выполнения. Там происходит обращение к абзацным стилям. Чтобы организовать список символьных стилей, нужно просто заменить везде в этих строках paragraph на character.

(Quick formatting)

Only The Necessary Information

(series of articles):

Cross-Reference — in Two Clicks

Having cross-references in a publication can significantly save time and nerves in the process of redesigning a layout, and not only the layout designer’s nerves. However, creating the cross-references via regular recommended procedures, in turn, requires so much time that it is quite natural when one decides to leave this venture alone and hope that, in a year or two, someone else will be preparing the reprint.

Indeed, some types of cross-references are created in two stages: first, a link to the text (an anchor) is created, then the link to this text itself is created. Each time you need to manually click different buttons a number of times. For example, this is how an anchor is created:

Creating the anchor

And something like this is done to create a reference to this anchor:

Creating the cross-reference

The same tasks can be completed through the "Cross-references" panel (as advised by the official manual), but this method is not much faster.

So, we have two operations, and this means that the whole process can (and should) be reduced to two buttons. We will do this by making use of the interface for typical operations, and adding the code for the two buttons there:

Buttons for creating cross-references

//Actions buttons group 4
//Actions buttons
var but4_1 = addWorkButton (pan4,"Add Text Anchor",80,0);
but4_1.onClick =function(){
	w.text = "Running...";
	var doc = app.activeDocument;
		var hname = doc.selection[0].parentTextFrames[0].parentPage.name+"-"+doc.selection[0].contents;
		var h= doc.hyperlinkTextDestinations.add(doc.selection[0],{name:hname});
	w.text = "Completed";
var but4_2 = addWorkButton (pan4,"Add Cross Ref",80,0);
but4_2.onClick =function(){
	w.text = "Running...";
	var doc = app.activeDocument;
		var h = doc.hyperlinkTextDestinations[-1];
		var t = doc.selection[0];
		var xRefForm = doc.crossReferenceFormats.item("Page Number");
		var s = doc.crossReferenceSources.add(t, xRefForm);
		var crref = doc.hyperlinks.add(s, h);
	w.text = "Completed";

Clicking on the first button creates an anchor named "Page-selected_text", for example, "6-Questions". Clicking on the second button will add a cross-reference of the "Page Number" type instead of the text selected at the moment of the click, or at the insertion point where the cursor is currently located. This link will reference the "anchor", which was created last (when the first button was pressed).