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://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
$("#setOption").click( function() { | |
foo("Option"); | |
} ); | |
function foo(id) { | |
if (document.getElementById(id).style.display == "none") { | |
document.getElementById(id).style.display = "block" | |
} else { | |
document.getElementById(id).style.display = "none" | |
} |
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://community.adobe.com/t5/photoshop/get-version-from-manifest-xml-cep-extension/m-p/10719134?page=1 | |
function getPluginVersion() { | |
const fs = require('fs'); | |
const path = csInterface.getSystemPath(SystemPath.EXTENSION); | |
const data = fs.readFileSync(`${path}/CSXS/manifest.xml`); | |
if (!data) { | |
needNewVersion = true; | |
return; |
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://community.adobe.com/t5/coding-corner/adobe-cep-v9-i-cant-seem-to-copy-the-html-text-from-panel-to-the-os-clipboard-with-javascript/m-p/10896257?page=1 | |
function click_copyList(){ | |
var copyText = document.getElementById("fileNameTable").innerText; // gets text from table | |
document.getElementById("holdText").innerText = copyText;//send table text to input field | |
document.getElementById("holdText").select();//select or highlight the input field text | |
document.execCommand("copy");//copy selected text | |
alert("copied the text!"); | |
} //end copyList |
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
document.body.onclick = function(e) { | |
e = e || window.event; | |
e = jQuery.event.fix(e); | |
alert([e.pageX, e.pageY]); | |
}; |
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 letters = app.activeDocument.textFrames[0].textRange.characters; | |
letters.length | |
letters[i].fillColor |
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 removeGuidesfromGroup(item) { | |
var el, el1; | |
var one = true; | |
for (var p = 0; p < item.length; p++) { | |
if (!item[p].guides) { | |
if (item[p].typename == 'GroupItem') { | |
one = false; | |
el = removeGuidesfromGroup(item[p].pageItems) | |
} else { | |
el = item[p].geometricBounds; |
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
// координаты выделенных объектов c учетом 'clipped' элементов | |
var Bds = doc.selection; | |
var coord = getGeometricSelect(Bds); | |
function getGeometricSelect(item) { | |
var el, el1; | |
// координаты первого элемента | |
el1 = getVisibleBounds(item[0], true); | |
// перебираем оставшиеся |
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/najti-perejti-k-frejmu-gde-tekst-ne-prilegaet-k-nizhnej-granice.75885/ | |
var tfs = app.activeDocument.textFrames.everyItem().getElements(); | |
for (var i = 0; i < tfs.length; i++) { | |
var tf = tfs[i]; | |
var line = tf.lines.lastItem(); | |
if (line.isValid) { | |
var bottom = tf.geometricBounds[2] - tf.textFramePreferences.insetSpacing[2]; | |
var baseline = line.baseline; | |
if (bottom - baseline > 0.1) { |