Skip to content

Instantly share code, notes, and snippets.

// 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();
//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; });
$("#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"
}
// 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;
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
document.body.onclick = function(e) {
e = e || window.event;
e = jQuery.event.fix(e);
alert([e.pageX, e.pageY]);
};
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;
var letters = app.activeDocument.textFrames[0].textRange.characters;
letters.length
letters[i].fillColor
// координаты выделенных объектов c учетом 'clipped' элементов
var Bds = doc.selection;
var coord = getGeometricSelect(Bds);
function getGeometricSelect(item) {
var el, el1;
// координаты первого элемента
el1 = getVisibleBounds(item[0], true);
// перебираем оставшиеся