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 dok = app.activeDocument; | |
| for (var i = 0; i < dok.swatches.length; i++) { | |
| try { | |
| dok.swatches[i].name = "prefix" + dok.swatches[i].name; | |
| } | |
| catch(e) { | |
| // could not rename | |
| } | |
| } |
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 matrice = app.transformationMatrices.add(1,1,0,0,0,0); | |
| spread.transform(CoordinateSpaces.PASTEBOARD_COORDINATES, AnchorPoint.CENTER_ANCHOR, matrice, [MatrixContent.ROTATION_VALUE, MatrixContent.SCALE_VALUES, MatrixContent.SHEAR_VALUE]); |
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
| // Based on https://github.com/indiscripts/extendscript/blob/master/scriptui/ProgressBar.jsx | |
| $.hasOwnProperty('ProgressBar')||(function(H/*OST*/,S/*ELF*/,I/*NNER*/) | |
| { | |
| H[S] = function ProgressBar(/*str*/title,/*uint*/width,/*uint*/height) | |
| { | |
| (60<=(width||0))||(width=340); | |
| (40<=(height||0))||(height=60); |
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 removeFolder(folder) { | |
| var result = folder.getFiles(); | |
| for (var i = result.length -1; i >= 0; i--) { | |
| var fileOrFolder = result[i]; | |
| if (fileOrFolder.exists) { | |
| if (fileOrFolder.constructor.name == "Folder") removeFolder(fileOrFolder); | |
| else fileOrFolder.remove(); | |
| } | |
| } | |
| folder.remove(); |
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 pad (number, length, fill) { | |
| if (fill === undefined) fill = "0"; | |
| var str = '' + number; | |
| while (str.length < length) { | |
| str = fill + str; | |
| } | |
| return str; | |
| } |
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
| app.findGrepPreferences = NothingEnum.NOTHING; | |
| app.changeGrepPreferences = NothingEnum.NOTHING; | |
| if (app.findChangeGrepOptions.hasOwnProperty ("searchBackwards")) { | |
| app.findChangeGrepOptions.searchBackwards = false; | |
| } | |
| app.findGrepPreferences.findWhat = ""; | |
| var findResults = dok.findGrep(); | |
| for (var fr = findResults.length-1; fr >= 0; fr--) { | |
| var findTextObject = findResults[fr]; |
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
| preflight(app.documents[0], "pdfCheck"); | |
| function preflight(dok, pprofilName) { | |
| var prefligthProfile = app.preflightProfiles.itemByName(pprofilName); | |
| if (!prefligthProfile.isValid) { | |
| var profilePath = new File ("/pathToProfil/pdfCheck.idpp") | |
| if (!profilePath.exists) { | |
| alert("Das Preflight Profil pdfCheck.idpp nicht gefunden"); | |
| return; | |
| } |
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
| try { | |
| var pstwp = app.clipboardPreferences.preferStyledTextWhenPasting; | |
| app.clipboardPreferences.preferStyledTextWhenPasting = false; | |
| var doc = app.documents[0]; | |
| var typoQ = doc.textPreferences.typographersQuotes; | |
| doc.textPreferences.typographersQuotes = false; | |
| var tf = doc.textFrames.add(); | |
| tf.insertionPoints[-1].select(); | |
| app.paste(); |
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 oldPreflight = app.activeDocument.preflightOptions.preflightOff; | |
| app.activeDocument.preflightOptions.preflightOff = false; | |
| // wait a maximum of 20 second for the preflight process. Before it runs, all Transactions should be closed. | |
| app.activeDocument.activeProcess.waitForProcess(20); | |
| app.activeDocument.preflightOptions.preflightOff = oldPreflight ; |
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 root = app.activeDocument; | |
| var styleString = getStyleString(app.selection[0].appliedObjectStyle); | |
| $.writeln(styleString); | |
| function getStyleString(style) { | |
| var nameArray = [style.name.replace(/:/g, '\\:')]; | |
| while (style.parent.constructor.name.indexOf("StyleGroup") > -1) { | |
| style = style.parent; | |
| nameArray.push(style.name.replace(/:/g, '\\:')); | |
| } |
NewerOlder