This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// text frame selected: | |
var frame = app.selection[0]; | |
var gap = frame.parentPage.bounds[2] - frame.parentPage.marginPreferences.bottom - frame.lines[-1].baseline; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GREP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( app.documents.length > 0 ) { | |
if ( app.scriptPreferences.version >= 6 ) { | |
app.doScript( main, ScriptLanguage.JAVASCRIPT , [], UndoModes.ENTIRE_SCRIPT, "Search in masterpages" ); | |
} | |
else { | |
main(); | |
} | |
} else { | |
alert ( "No documents open!" ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( app.documents.length > 0 ) { | |
if ( app.scriptPreferences.version >= 6 ) { | |
app.doScript( main, ScriptLanguage.JAVASCRIPT , [], UndoModes.ENTIRE_SCRIPT, "Search in masterpages" ); | |
} | |
else { | |
main(); | |
} | |
} else { | |
alert ( "No documents open!" ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( app.documents.length > 0 ) { | |
if ( app.scriptPreferences.version >= 6 ) { | |
app.doScript( main, ScriptLanguage.JAVASCRIPT , [], UndoModes.ENTIRE_SCRIPT, "Search in masterpages" ); | |
} | |
else { | |
main(); | |
} | |
} else { | |
alert ( "No documents open!" ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addTextToPara(pStyleName, prefixText) | |
{ | |
app.findGrepPreferences.appliedParagraphStyle = pStyleName | |
var paraList = app.activeDocument.findGrep() | |
for(var i = 0 ; i < paraList.length; i++) | |
{ | |
paraList[i].contents = prefixText + paraList[i].contents | |
} | |
app.findGrepPreferences = NothingEnum.nothing; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Минимальное | |
Array.prototype.min = function(){ | |
var min = parseInt(this[this.length-1]), el; | |
for(var i=this.length-2; i>=0; i--){ | |
el = parseInt(this[i]); | |
if(el<min){ | |
min = el; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var aDoc = app.activeDocument; | |
var showLayers = function ( layers ) | |
{ | |
var i = layers.length, layer; | |
while ( i-- ) | |
{ | |
layer = layers[i]; | |
layer.visible = true; | |
layer.layers.length && showLayers ( layer.layers ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#target "Indesign" | |
main(); | |
function main(){ | |
if (app.activeDocument.selection.length){ | |
var mySel = app.activeDocument.selection; | |
var l = mySel.length; | |
for (var i = 0; i < l; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
customAlert('Hello', 3, 'This is a test - Will close in 3 seconds') | |
customAlert('Hello', 0, 'This is a test - Will not close automatically') | |
function customAlert(message, delaySeconds, title){ | |
title = title || 'Alert'; | |
var alertWindow = new Window('palette', title); | |
var control_text = alertWindow.add('edittext', [0, 0, 500, 200], message, {multiline: true}); | |
if(delaySeconds == 0){ | |
var control_close = alertWindow.add('button', undefined, 'Close'); |
OlderNewer