This file contains hidden or 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 extractAllTables () { | |
var oTables = []; | |
function getTables (oParent) { | |
var outTables = oParent[oParent.constructor.name == 'Table' ? 'cells' : 'stories'].everyItem().tables.everyItem().getElements(), | |
len = outTables.length, | |
i = 0; | |
oTables = oTables.concat(outTables); | |
for (; i < len; i++) outTables[i].cells.everyItem().tables.everyItem().getElements().length && getTables(outTables[i]); | |
} | |
getTables(app.activeDocument); |
This file contains hidden or 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 (){ | |
app.findGrepPreferences.findWhat = '~a\r.+'; | |
var d = app.activeDocument, | |
f = Folder.selectDialog ('选中图像根目录文件夹'), | |
R = d.findGrep(), | |
RL = R.length, i = 0; | |
for (; i < RL; i++){ | |
var images = getFileFromFolder(f, R[i].contents.match(/\S{2,}/)[0]), | |
real; |
This file contains hidden or 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 (){ | |
var op = new TiffSaveOptions; | |
op.imageCompression = TIFFEncoding.TIFFLZW; | |
app.documents.length == 1 && splitChannels (activeDocument); | |
function splitChannels (doc) { | |
var fn = doc.name, | |
fp = doc.path, | |
md = doc.mode, | |
base = fn.replace(/\.\w{2,4}$/, ''), |
This file contains hidden or 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 (){ | |
var f = Folder.selectDialog ('选择文件夹'), | |
fA = f.getFiles ('*.tif'), | |
fs = f.fsName, | |
op = new TiffSaveOptions, | |
i = 0; | |
op.imageCompression = TIFFEncoding.TIFFLZW; // 设置LZW压缩 | |
for (; i < fA.length; i += 5){ | |
process (fA[i]); | |
} |
This file contains hidden or 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
script.coordinateSystem = "bottom-up"; | |
var values = { | |
type: '径向', | |
opacity: !1, | |
center: !0, | |
count: 2, | |
random: !0, | |
colormode: '随机', | |
start: 60, | |
end: 120, |
This file contains hidden or 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
// yet another Scriptographer script | |
var oPath = document.selectedItems[0], | |
// u = oPath.reverse(), | |
len = oPath.length, | |
segments = oPath.segments, | |
parts = 20, | |
i = 0; | |
for (; i <= parts; i++) { | |
var point = oPath.getLocation(len / parts * i).point, |
This file contains hidden or 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
// This is a Scriptographer script | |
document.getItems({ | |
type: Path, | |
hidden: false | |
}).each(function (path){ | |
var curves = path.curves, i = curves.length - 1, curve, curvePre; | |
for (; i > 0; i--){ | |
curve = curves[i]; | |
curvePre = curve.previous; | |
curve.isLinear() && curvePre.isLinear() && |
This file contains hidden or 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 environVar = ["ALLUSERSPROFILE", "PROGRAMDATA", "APPDATA", "COMPUTERNAME", "COMMONPROGRAMFILES", "COMMONPROGRAMFILES(x86)", "COMSPEC", "HOMEDRIVE", "HOMEPATH", "LOCALAPPDATA", "LOGONSERVER", "PATH", "PATHEXT", "PROGRAMFILES", "PROGRAMFILES(X86)", "PROMPT", "SystemDrive", "SystemRoot", "TEMP", "USERDOMAIN", "USERNAME", "USERPROFILE", "WINDIR", "PUBLIC", "PROGRAMDATA", "PSModulePath", "PROCESSOR_ARCHITECTURE", "PROCESSOR_ARCHITEW6432"], | |
i = 0, len = environVar.length; | |
for (; i< len; i++){ | |
$.writeln(environVar[i] + ': ' + $.getenv(environVar[i])); | |
} |
This file contains hidden or 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
//only for mark. For work, use John Wundes's script please. | |
//http://www.wundes.com/JS4AI/delete_fluff.js | |
function deleteUnusedSwatches (doc) { | |
var items = doc.pageItems, | |
len = items.length, | |
sw = doc.swatches, | |
slen = sw.length, | |
arr = [], | |
str = null, |
This file contains hidden or 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 () { | |
function layersText(oDoc) { | |
var oLayers = oDoc.layers, text = [], i, j, file; | |
function getTextLayers(oLayers, i) { | |
for (i = 0; i < oLayers.length; i++) { | |
oLayers[i].layers ? getTextLayers(oLayers[i].layers, j) : oLayers[i].kind == LayerKind.TEXT && text.push(oLayers[i].textItem.contents); | |
} | |
} | |
getTextLayers(oLayers, i); | |
file = new File(String(oDoc.fullName).replace(/(psd|tiff?)$/i, 'txt')); |