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
//https://stackoverflow.com/questions/21631437/getfiles-not-folders | |
// список файлов в папке | |
var sourceFolder = new Folder("E:/Hame/_FTP/Sticker/_OLD"); | |
var fileList = sourceFolder.getFiles(function(f) { return f instanceof File; }); | |
// список директорий | |
var fileList = sourceFolder.getFiles(function(f) { return f instanceof Folder; }); |
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
// https://forum.rudtp.ru/threads/zamena-sontents-s-soxraneniem-formatirovanija.74869/ | |
//tf.characters[j].contents=tmp; | |
var ip = tf.insertionPoints[j]; | |
ip.characters.add(tmp); | |
tf.characters[j+1].remove(); | |
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
https://forum.rudtp.ru/threads/skript-dlja-giperssylki-na-url-iz-klipborda.75166/ | |
function clipboard2hyperlink () { | |
if (!app.documents.length) { | |
return false; | |
} | |
var doc = app.activeDocument; | |
if (app.selection.length != 1 || !app.selection[0].hasOwnProperty('characters')) { | |
return false; | |
} |
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'); |
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
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
Минимальное | |
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
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
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!" ); | |
} |