left menu mob button

New Video on YouTube:

Lost Time is never found again. (Benjamin Franklin)


Comments

Admin
(12.10.2020 20:18):

Galeb, for example: forum.rudtp.ru/threads/scriptpalette.75192/

(Interface for Typical Operations)

Galeb
(11.10.2020 23:51):

Hi there, just out of curiosity... which analogous scripts on the Web are you referring to? I'm looking for a possibility to make a custom dock/panel where I can add certain Skripts as a button and maybe the most used features also. Appreciate your input on that topic. Best from Croatia, Galeb

(Interface for Typical Operations)

Danko Josic
(05.06.2020 1:08):

Thank you. Great help.

(Common Formatting of Several Tables)

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;
	try{
		var hname = doc.selection[0].parentTextFrames[0].parentPage.name+"-"+doc.selection[0].contents;
		var h= doc.hyperlinkTextDestinations.add(doc.selection[0],{name:hname});
		}
	catch(e){alert(e.description);}
	w.text = "Completed";
	app.activate();
	}
//*/
//*
var but4_2 = addWorkButton (pan4,"Add Cross Ref",80,0);
but4_2.onClick =function(){
	w.text = "Running...";
	var doc = app.activeDocument;
	try{
		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);
		}
	catch(e){alert(e.description);}
	w.text = "Completed";
	app.activate();
	}
//*/

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).

dnlbutton

No comments.

Leave a comment:

Name*:
E-mail*:
Comment text*:
Security code*: