├── .gitignore ├── README.md ├── Run_Script.jsx └── Scripts ├── Adjust_Layout.jsx ├── Align_2_Grid.jsx ├── Baseline_2_Grid.jsx ├── Baseline_Fitter.jsx ├── Baseline_Stepper.jsx ├── Bounds_Memory.jsx ├── Calculate_DPI_based_Dimensions.jsx ├── Calculate_Spine_Width.jsx ├── Checkbox_Toggle.jsx ├── Clean_Pasteboard.jsx ├── Compare_Two_Documents.jsx ├── Draw_Handles.jsx ├── Export_Book.jsx ├── Export_Book_2_JPG.jsx ├── Export_Multiple_PDF_JPG.jsx ├── FindChangeByList_B.jsx ├── FindChangeSupport └── Text Soap.txt ├── Find_Master.jsx ├── Fix_Next_Styles.jsx ├── Fix_ParagraphStyle_Pairs.jsx ├── Fix_Paragraph_Endleading.jsx ├── Frame_2_Margin.jsx ├── Frame_2_Page.jsx ├── Frame_2_PageBleed.jsx ├── Frame_2_Spread.jsx ├── Frame_2_SpreadBleed.jsx ├── Frame_Break_2_Pagebounds.jsx ├── Frame_Divider.jsx ├── Frame_Splits_Story.jsx ├── Frame_Splits_Story_UI.jsx ├── Frames_2_Bleed.jsx ├── Frames_Merge.jsx ├── Generate_Auto_CharacterStyles.jsx ├── Generate_Auto_Paragraph+CharacterStyles.jsx ├── Generate_Rectangle_2_SpreadBleed.jsx ├── Generate_Speech_Balloon.jsx ├── Glyph_Replacer.jsx ├── Glyph_Replacer_Fonts └── AmericanTypewriter-CondensedLight-67pt │ ├── 100.psd │ ├── 101.psd │ ├── 102.psd │ ├── 103.psd │ ├── 104.psd │ ├── 105.psd │ ├── 106.psd │ ├── 107.psd │ ├── 108.psd │ ├── 109.psd │ ├── 110.psd │ ├── 111.psd │ ├── 112.psd │ ├── 113.psd │ ├── 114.psd │ ├── 115.psd │ ├── 116.psd │ ├── 117.psd │ ├── 118.psd │ ├── 119.psd │ ├── 120.psd │ ├── 121.psd │ ├── 122.psd │ ├── 32.psd │ ├── 48.psd │ ├── 49.psd │ ├── 50.psd │ ├── 51.psd │ ├── 52.psd │ ├── 53.psd │ ├── 54.psd │ ├── 55.psd │ ├── 56.psd │ ├── 57.psd │ ├── 59.psd │ ├── 65533.psd │ ├── 97.psd │ ├── 98.psd │ ├── 99.psd │ ├── test.eps │ └── test.psd ├── Grid_Fit.jsx ├── Images_Unembed_All.jsx ├── Import_Files_2_Pages.jsx ├── Import_Files_2_Spread.jsx ├── Import_Files_Insert_Pages.jsx ├── Import_Fore_Edge_Bleed.jsx ├── Import_Multiple_Files.jsx ├── Import_Place_Image_References.jsx ├── Insert_Impression_Numbers.jsx ├── Margins_2_Grid.jsx ├── Margins_Read_Actual.jsx ├── Master_2_Style.jsx ├── Master_2_Style_Live.jsx ├── Master_2_Style_UI.jsx ├── Master_None_2_Empty_Pages.jsx ├── Optical_Margin_Batch.jsx ├── PDF_Options_Editor.jsx ├── Page_Goto.jsx ├── Pages_Border.jsx ├── ParagraphStyle_GetSet_xHeight.jsx ├── ParagraphStyle_Orphan_Fixer.jsx ├── ParagraphStyle_Pair.jsx ├── ParagraphStyle_Remove_Overides.jsx ├── Quotes_Reverse_Style.jsx ├── Quotes_Toggle.jsx ├── Random_Letter_Jitter.jsx ├── Random_Letter_Presser.jsx ├── Random_Number_Insert.jsx ├── Random_Point_Coordinates.jsx ├── Random_Rotate_Between_Values.jsx ├── Remove_Doc_Effects.jsx ├── Remove_Frame_Rotation.jsx ├── Remove_Guides.jsx ├── Remove_Paragraph_Overrides.jsx ├── Replace_Link_Tint.jsx ├── Replace_Master.jsx ├── Rotate_Bewteen_Values_Memory.txt ├── Section_2_Master.jsx ├── Selection_2_Photoshop.jsx ├── Selection_Template.jsx ├── Slug_NumberSpreads.jsx ├── Spirograph.jsx ├── Story_2_Margin.jsx ├── Story_Sort_Paragraph_LastCharX.jsx ├── Story_Splitter.jsx ├── Tables_2_Frame.jsx ├── TextFrame-Inline_Remove.js ├── Text_2_Layer.jsx ├── Text_2_TextFrame-Inline.jsx ├── Text_2_breakFrame.jsx ├── Text_Change_Case_With_Style.jsx ├── Transpose.jsx ├── View_Nobreak.jsx ├── View_Overrides.jsx ├── XML_Runner.jsx ├── kern ├── kern.jsx ├── kern_Adobe Caslon Pro.txt ├── kern_Bembo Std.txt ├── kern_Blanco.txt ├── kern_Dolly.txt ├── kern_Emona.txt ├── kern_IM FELL Great Primer PRO.txt ├── kern_Italian Old Style MT.txt ├── kern_Minion Pro.txt ├── kern_Times LT Std.txt └── manual.html └── test.jsx /.gitignore: -------------------------------------------------------------------------------- 1 | Find_Master_Memory.txt 2 | 3 | .Run_Script_History.txt 4 | 5 | MultiPageImporterPrefs2.5.txt 6 | 7 | Random Tools/Rotate_Bewteen_Values_Memory.txt 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Novelty 2 | ======= 3 | 4 | Scripts for bookdesigners. 5 | 6 | All scripts can be loaded from the Novelty/Scripts Folder. 7 | However using the [`Run_Script.jsx`](Run_Script.jsx) file contributed by [Peter Kahrel](http://www.kahrel.plus.com) you can search and launch a script by typing its name or picking it from the recent-history list. 8 | 9 | You can find more info in the [project wiki](https://github.com/GitBruno/Novelty/wiki). 10 | 11 | Installation 12 | ------------ 13 | 14 | You can copy these files directly into your [InDesign Scripts](https://github.com/GitBruno/Novelty/wiki/Installing-Scripts) folder however if you'd like to contribue consider `git clone`. 15 | 16 | Contribute 17 | ---------- 18 | 19 | * [Report bugs](https://github.com/GitBruno/Novelty/issues) 20 | * [Request features/scripts](https://github.com/GitBruno/Novelty/issues) 21 | * [Add new tools](https://github.com/GitBruno/Novelty/pulls) 22 | * [Write documentation](https://github.com/GitBruno/Novelty/wiki) 23 | -------------------------------------------------------------------------------- /Scripts/Align_2_Grid.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Align_2_Grid.jsx 4 | Version 1.0 5 | Bruno Herfst 2011 - 2018 6 | 7 | An InDesign JavaScript to align page-items to Document Grid 8 | 9 | */ 10 | 11 | #target InDesign; 12 | 13 | var Settings = { 14 | alignInset : true 15 | }; 16 | 17 | try { 18 | //global vars 19 | var myDoc = app.activeDocument; 20 | //save measurements units 21 | myOldXUnits = myDoc.viewPreferences.horizontalMeasurementUnits, 22 | OldYUnits = myDoc.viewPreferences.verticalMeasurementUnits; 23 | 24 | setRulerUnits(myDoc, MeasurementUnits.points, MeasurementUnits.points); 25 | var G = getGridDivision(myDoc); 26 | 27 | function alignBounds( myPageItem ){ 28 | var bounds = myPageItem.geometricBounds; //array [y1, x1, y2, x2], [top, left, bottom, right] 29 | myPageItem.geometricBounds = [roundTo(bounds[0],G.h), roundTo(bounds[1],G.w), roundTo(bounds[2],G.h), roundTo(bounds[3],G.w)]; 30 | }; 31 | 32 | function alignInset( myTextFrame ){ 33 | var inset = myTextFrame.textFramePreferences.insetSpacing; //array [y1, x1, y2, x2], [top, left, bottom, right] 34 | myTextFrame.textFramePreferences.insetSpacing = [roundTo(inset[0],G.h), roundTo(inset[1],G.w), roundTo(inset[2],G.h), roundTo(inset[3],G.w)]; 35 | }; 36 | 37 | if(app.selection.length != 0){ 38 | //Get the first item in the selection. 39 | for(var i=0;i 4) { 52 | prevBounds = (new Function("return [" + prevBounds + "];")()); 53 | } 54 | 55 | var myDialog = new Window ("dialog", "Bounds Bounce"); 56 | myDialog.orientation = "row"; 57 | myDialog.alignment = "left"; 58 | myDialog.alignChildren = "left"; 59 | myDialog.margins = [20,20,20,25]; 60 | 61 | //Buttons 62 | //------- 63 | var copyBut = myDialog.add ("button", undefined, "Copy", {name:"copy"} ); 64 | copyBut.onClick = function() { 65 | this.parent.close(1); 66 | } 67 | 68 | if(prevBounds.constructor === Array) { 69 | var pasteBut = myDialog.add ("button", undefined, "Paste", {name:"paste"} ); 70 | pasteBut.onClick = function() { 71 | this.parent.close(2); 72 | } 73 | } 74 | 75 | var returnVal = myDialog.show(); 76 | if ( returnVal == 1) { 77 | saveBounds( selBounds ); 78 | } else if ( returnVal == 2) { 79 | applyBounds( mySelection, prevBounds ); 80 | } // else user pressed cancel 81 | } 82 | 83 | main(); 84 | 85 | -------------------------------------------------------------------------------- /Scripts/Calculate_DPI_based_Dimensions.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Get_DPI_based_Dimensions.jsx 4 | An Adobe Bridge CS4 javascript 5 | For getting actual file demensions in millimeters at 300 DPI 6 | Select some files in Adobe Bridge and run the script 7 | 8 | Bruno Herfst 2011 9 | 10 | */ 11 | 12 | #target bridge 13 | 14 | var set = { where : "~/Desktop/300DPI_Dimensions.txt" , // where to safe the txt file 15 | dpi : 300 } // actual size at set DPI 16 | 17 | var allFiles = new Array; 18 | var txt = ""; 19 | 20 | try { 21 | // Returns Array 22 | var selectedThumbnails = app.document.selections; 23 | if(selectedThumbnails.length == 0) { 24 | alert("Select some files first in Adobe Bridge"); 25 | exit(); 26 | } else if(selectedThumbnails[0].type == "folder") { 27 | alert("Only select pictures please"); 28 | exit(); 29 | } 30 | } catch(err) { 31 | throwError(err); 32 | } 33 | 34 | for(var i = 0; i < selectedThumbnails.length; i++) { 35 | var myFile = new Array; 36 | // Test with first item of Array 37 | myFile["file"] = selectedThumbnails[i]; 38 | myFile["filename"] = selectedThumbnails[i].name; 39 | 40 | // Get metadata from thumbnail 41 | var md = myFile.file.synchronousMetadata; 42 | 43 | //Let’s store values in an array 44 | var x = md.read('http://ns.adobe.com/exif/1.0/',"PixelXDimension"); 45 | var y = md.read('http://ns.adobe.com/exif/1.0/',"PixelYDimension"); 46 | //make mm mm = 254 * pixels / dpi; 47 | myFile["Xmm"] = doRound((25.4 * x)/set.dpi,2); 48 | myFile["Ymm"] = doRound((25.4 * y)/set.dpi,2); 49 | 50 | //alert(myFile.filename + '\n\nW ' + myFile["Xmm"] + ' x H ' + myFile["Ymm"] + ' mm'); 51 | allFiles.push(myFile); 52 | } 53 | 54 | function doRound(myNum, roundDec) { 55 | var roundMulit = Math.pow(10,roundDec); 56 | return Math.round(myNum*roundMulit)/roundMulit; 57 | } 58 | 59 | for(var i = 0; i < allFiles.length; i++) { 60 | txt += "W " + allFiles[i].Xmm + " \t H " + allFiles[i].Ymm + " \t" + allFiles[i].filename + "\n"; 61 | } 62 | 63 | // Save file 64 | textFile = File(set.where); 65 | if(!textFile.exists) { 66 | saveTXT(txt); 67 | } else { 68 | saveTXT(txt); 69 | } 70 | 71 | // function to save to a txtfile 72 | function saveTXT(txt){ 73 | try{ 74 | textFile.open("w"); 75 | textFile.write(txt); 76 | textFile.close(); 77 | alert("You can find the data here: \n\n" + textFile); 78 | } 79 | catch(e){ 80 | throwError("Could not save file: " + e, false, 2, textFile); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /Scripts/Calculate_Spine_Width.jsx: -------------------------------------------------------------------------------- 1 | /* A quick sketch to estimate spine widths from Griffin */ 2 | 3 | #target indesign; 4 | 5 | var papers = new Array(); 6 | 7 | papers.push({ 8 | name:"Griffin Paperback Cream 65gsm", 9 | glue: 0.51, 10 | thickness: 0.07, 11 | units: 2053991795 12 | },{ 13 | name:"Griffin Paperback Cream 50gsm", 14 | glue: 0.51, 15 | thickness: 0.06, 16 | units: 2053991795 17 | }); 18 | 19 | function getPropList( obj, key ) { 20 | var len = obj.length; 21 | var propList = new Array(); 22 | for (var i = 0; i < len; i++) { 23 | propList[i] = obj[i][key]; 24 | } 25 | return propList; 26 | } 27 | 28 | function calculateSpine( paper, extend ) { 29 | return (paper.thickness * parseInt(extend)) + paper.glue; 30 | } 31 | 32 | function displayDialog() { 33 | 34 | var w = new Window ("dialog"); 35 | w.alignChildren = "left"; 36 | 37 | var preset = w.add ("group"); 38 | var paperDrop = preset.add ("dropdownlist", undefined, getPropList(papers,"name")); 39 | paperDrop.selection = 0; 40 | 41 | var myInputGroup = w.add ("group"); 42 | myInputGroup.add ("statictext", undefined, "Extend:"); 43 | var extend = myInputGroup.add ("edittext", undefined, "96"); 44 | extend.characters = 5; 45 | extend.active = true; 46 | var mySpineLabel = myInputGroup.add ("statictext", undefined, " Spine:"); 47 | //mySpineLabel.characters = 6; 48 | var spine = myInputGroup.add ("edittext", undefined, "0"); 49 | spine.characters = 6; 50 | extend.active = false; 51 | var units = myInputGroup.add ("statictext", undefined, "mm"); 52 | 53 | var buttons = w.add ("group") 54 | buttons.add ("button", undefined, "OK", {name: "ok"}); 55 | buttons.add ("button", undefined, "Cancel", {name: "cancel"}); 56 | 57 | // Add functionality 58 | function updateSpine() { 59 | spine.text = calculateSpine(papers[paperDrop.selection.index],parseInt(extend.text)); 60 | } 61 | 62 | paperDrop.onChange = function () { 63 | updateSpine(); 64 | } 65 | extend.onChange = function () { 66 | updateSpine(); 67 | } 68 | 69 | w.show (); 70 | 71 | } 72 | 73 | try { 74 | displayDialog(); 75 | } catch ( err ) { 76 | alert( err.description ); 77 | } 78 | -------------------------------------------------------------------------------- /Scripts/Checkbox_Toggle.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Checkbox_Toggle.jsx 4 | Version 1.0 5 | Bruno Herfst 2016 6 | 7 | A quick way to toggle a CheckBox 8 | 9 | */ 10 | 11 | #target InDesign; 12 | 13 | try { 14 | //global vars 15 | var myDoc = app.activeDocument; 16 | 17 | if(app.selection.length != 0){ 18 | selLen = app.selection.length; 19 | // Changing the activeStateIndex causes InDesign 20 | // to delselect objest so we save te current selecton 21 | // and reselect them again on exit 22 | var items = new Array(); 23 | for(var i=0; i=0; i--){ 54 | doSomethingWithSelectedItem(item.allPageItems[i]); 55 | } 56 | } else if(item.constructor.name == 'CheckBox') { 57 | if(item.activeStateIndex == 1) { 58 | item.activeStateIndex = 0; 59 | } else if(item.activeStateIndex == 0) { 60 | item.activeStateIndex = 1; 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /Scripts/Draw_Handles.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Draw_Handles.jsx 4 | Version 1.0 5 | Bruno Herfst 2014 6 | 7 | This script visualises the path so we can print the curve representation 8 | 9 | */ 10 | 11 | #target InDesign 12 | 13 | var Settings = { 14 | anchorDraw : true, 15 | anchorRadius : 0.35, 16 | anchorColour : [100,0,0,0], 17 | 18 | controlPointDraw : true, 19 | controlPointRadius : 0.2, 20 | controlPointColour : [100,0,0,0], 21 | 22 | outlineDraw : false, // this creates a copy of the object first 23 | outlineStroke : 0.15, 24 | outlineColour : [100,0,0,0] 25 | } 26 | 27 | //Make certain that user interaction (display of dialogs, etc.) is turned on. 28 | app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; 29 | 30 | //Check if we have what we need to run the script. 31 | if (app.documents.length == 0){ 32 | alert("Open a document before running this script."); 33 | exit(); 34 | } else if (app.selection.length == 0){ 35 | alert("Select an object before running this script"); 36 | exit(); 37 | } 38 | 39 | var myPathList = new Array; 40 | 41 | for(var i = 0;i < app.selection.length; i++){ 42 | switch (app.selection[i].constructor.name){ 43 | case "Rectangle": 44 | case "TextFrame": 45 | case "Oval": 46 | case "Polygon": 47 | case "GraphicLine": 48 | case "Group": 49 | case "PageItem": 50 | myPathList.push(app.selection[i]); 51 | break; 52 | } 53 | } 54 | if (myPathList.length == 0){ 55 | alert ("Select a rectangle or text frame and try again."); 56 | exit(); 57 | } 58 | 59 | drawPathElements(myPathList); 60 | 61 | function drawPathElements(myPathList){ 62 | for(var objCount = 0;objCount < myPathList.length; objCount++){ 63 | for(var pathCount = 0;pathCount < myPathList[objCount].paths.length; pathCount++){ 64 | var myPath = myPathList[objCount].paths[pathCount]; 65 | drawAnchors(myPath); 66 | } 67 | } 68 | } 69 | 70 | function drawAnchors(myPath){ 71 | try{ 72 | for(var point = 0;point < myPath.entirePath.length; point++){ //we process last point later for closed paths only 73 | if(myPath.entirePath[point].length == 2){ // no control handles 74 | if(Settings.anchorDraw){ 75 | drawCircle(app.activeWindow.activePage,myPath.entirePath[point], Settings.anchorRadius); 76 | } 77 | } else { // controlHandles found 78 | 79 | var leftHandle = myPath.entirePath[point][0]; 80 | var actualPoint = myPath.entirePath[point][1]; 81 | var rightHandle = myPath.entirePath[point][2]; 82 | 83 | if(Settings.anchorDraw){ 84 | drawCircle(app.activeWindow.activePage, actualPoint, Settings.anchorRadius); 85 | } 86 | if(Settings.controlPointDraw){ 87 | if(leftHandle !== actualPoint){ 88 | drawCircle(app.activeWindow.activePage, leftHandle, Settings.controlPointRadius); 89 | } 90 | if(rightHandle !== actualPoint){ 91 | drawCircle(app.activeWindow.activePage, rightHandle, Settings.controlPointRadius); 92 | } 93 | } 94 | } 95 | } 96 | } catch(err){ 97 | alert(err); 98 | } 99 | } 100 | 101 | function drawCircle(page, point, radius){ 102 | var bounds = [point[1]-radius,point[0]-radius,point[1]+radius,point[0]+radius]; //y1,x1,y2,x2 103 | page.ovals.add({geometricBounds:bounds}); 104 | } 105 | -------------------------------------------------------------------------------- /Scripts/Export_Book_2_JPG.jsx: -------------------------------------------------------------------------------- 1 | // Export_Book_2_JPG.jsx 2 | // An indesign javascript based on a snippet from Jongware 3 | // Source: https://forums.adobe.com/thread/619756 4 | 5 | // Bruno Herfst 2017 6 | 7 | // TODO: UI for settings + save location 8 | 9 | var standardSettings = { 10 | exportingSpread : true, 11 | jpegExportRange : ExportRangeOrAllPages.EXPORT_ALL, 12 | jpegRenderingStyle : JPEGOptionsFormat.BASELINE_ENCODING, 13 | exportResolution : 300, 14 | antiAlias : true, 15 | jpegQuality : JPEGOptionsQuality.MAXIMUM, 16 | simulateOverprint : true, 17 | useDocumentBleeds : true, 18 | jpegColorSpace : JpegColorSpaceEnum.GRAY, 19 | embedColorProfile : false 20 | } 21 | 22 | function setExportOptions( options ) { 23 | // Save original settings 24 | var originalPrev = new Object(); 25 | originalPrev.exportingSpread = app.jpegExportPreferences.exportingSpread; 26 | originalPrev.jpegExportRange = app.jpegExportPreferences.jpegExportRange; 27 | originalPrev.jpegRenderingStyle = app.jpegExportPreferences.jpegRenderingStyle; 28 | originalPrev.exportResolution = app.jpegExportPreferences.exportResolution; 29 | originalPrev.antiAlias = app.jpegExportPreferences.antiAlias; 30 | originalPrev.jpegQuality = app.jpegExportPreferences.jpegQuality; 31 | originalPrev.simulateOverprint = app.jpegExportPreferences.simulateOverprint; 32 | originalPrev.useDocumentBleeds = app.jpegExportPreferences.useDocumentBleeds; 33 | originalPrev.jpegColorSpace = app.jpegExportPreferences.jpegColorSpace; 34 | originalPrev.embedColorProfile = app.jpegExportPreferences.embedColorProfile; 35 | 36 | app.jpegExportPreferences.exportingSpread = options.exportingSpread; 37 | app.jpegExportPreferences.jpegExportRange = options.jpegExportRange; 38 | app.jpegExportPreferences.jpegRenderingStyle = options.jpegRenderingStyle; 39 | app.jpegExportPreferences.exportResolution = options.exportResolution; 40 | app.jpegExportPreferences.antiAlias = options.antiAlias; 41 | app.jpegExportPreferences.jpegQuality = options.jpegQuality; 42 | app.jpegExportPreferences.simulateOverprint = options.simulateOverprint; 43 | app.jpegExportPreferences.useDocumentBleeds = options.useDocumentBleeds; 44 | app.jpegExportPreferences.jpegColorSpace = options.jpegColorSpace; 45 | app.jpegExportPreferences.embedColorProfile = options.embedColorProfile; 46 | 47 | return originalPrev; 48 | } 49 | 50 | if (app.books.length != 1) { 51 | alert ("This only works when you have one (1) book open"); 52 | } else { 53 | // Don't show profile mismatches 54 | var originalUserInteractionLevel = app.scriptPreferences.userInteractionLevel; 55 | app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract; 56 | 57 | var userExportPref = setExportOptions( standardSettings ); 58 | 59 | for (var b=0; bfindPropertieschangePropertiesfindChangeOptionsdescription 9 | // 10 | //Where: 11 | // is a tab character 12 | //findType is "text", "grep", or "glyph" (this sets the type of find/change operation to use). 13 | //findProperties is a properties record (as text) of the find preferences. 14 | //changeProperties is a properties record (as text) of the change preferences. 15 | //findChangeOptions is a properties record (as text) of the find/change options. 16 | //description is a description of the find/change operation 17 | // 18 | //Very simple example: 19 | //text {findWhat:"--"} {changeTo:"^_"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double dashes and replace with an em dash. 20 | // 21 | //More complex example: 22 | //text {findWhat:"^9^9.^9^9"} {appliedCharacterStyle:"price"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find $10.00 to $99.99 and apply the character style "price". 23 | // 24 | //All InDesign search metacharacters are allowed in the "findWhat" and "changeTo" properties for findTextPreferences and changeTextPreferences. 25 | // 26 | //If you enter backslashes in the findWhat property of the findGrepPreferences object, they must be "escaped" 27 | //as shown in the example below: 28 | // 29 | //{findWhat:"\\s+"} 30 | // 31 | 32 | grep {findWhat:"(?<=[[:blank:]])[[:blank:]]+"} {changeTo:""} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double spaces and replace with single spaces. 33 | grep {findWhat:"(?<=\\r)[[:blank:]]+"} {changeTo:""} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Removed all wordspaces that precede a return. 34 | grep {findWhat:"[[:blank:]]+(?=\\r)"} {changeTo:""} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Removed all wordspaces that follow a return. 35 | grep {findWhat:"(?<=\\t)\\t+"} {changeTo:""} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double tab characters and replace with single tab characters. 36 | grep {findWhat:"\\r(?=\\t)"} {changeTo:""} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all returns followed by a tab character and replace with single returns. 37 | grep {findWhat:"(?<=\\t)\\r"} {changeTo:""} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all tabs followed by a return character and replace with single returns. 38 | grep {findWhat:"(?<=\\r)\\r+"} {changeTo:""} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double returns and replace with single returns. 39 | // Dashes 40 | grep {findWhat:"[[:blank:]]-[[:blank:]]"} {changeTo:"~<~=~<"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all space-dash-space and replace with an thin spaced en dash. 41 | grep {findWhat:"[[:blank:]]-$"} {changeTo:"~<~="} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all space-dash at the end of paragraph and replace with an thin spaced en dash. 42 | grep {findWhat:"^-[[:blank:]]"} {changeTo:"~=~<"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all dash-space at the beginning of paragraph and replace with an thin spaced en dash. 43 | grep {findWhat:"(?<=\d)-(?=\d)"} {changeTo:"~="} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all digit-dash-digit and replace with an en-dash. 44 | grep {findWhat:"--"} {changeTo:"~<^_~<"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all dash-dash and replace with an thin spaced em dash. 45 | // Style ellipsis 46 | grep {findWhat:"(\\.(\\s)?\\.(\\s)?\\.)|(~e)"} {changeTo:".~s.~s."} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all ellipsis and replace with fixed width non breaking spaced ellipsis. 47 | grep {findWhat:"[[:blank:]]\\.[[:blank:]]\\.[[:blank:]]\\."} {changeTo:"~s.~s.~s."} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all ellipsis and replace with fixed width non breaking space before ellipsis. 48 | grep {findWhat:"\\.[[:blank:]]\\.[[:blank:]]\\.[[:blank:]]"} {changeTo:".~s.~s.~s"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all ellipsis and replace with fixed width non breaking space after ellipsis. 49 | grep {findWhat:"\\>\\.~s\\.~s\\."} {changeTo:"~s.~s.~s."} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all elipsis that that follow a word and add thin space 50 | grep {findWhat:"\\.~s\\.~s\\.\\<"} {changeTo:".~s.~s.~s"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all elipsis that are followed by a word and add thin space 51 | // Force smartquotes (Make sure InDesign smart quotes is turned on!) Don't do this on large documents it's too slow! 52 | //text {findWhat:"\'"} {changeTo:"\'"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Replace single quotes 53 | //text {findWhat:"\""} {changeTo:"\""} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Replace double quotes 54 | -------------------------------------------------------------------------------- /Scripts/Find_Master.jsx: -------------------------------------------------------------------------------- 1 | /*//////////////////////////////////////////////////////////////// 2 | 3 | Find_Master.jsx 4 | Version 1.2 5 | InDesign CS5 javascript 6 | 7 | Bruno Herfst 2011 8 | 9 | Go to the next page the selected master is applied to. 10 | 11 | Save preferences functionality powered by Scott Zanelli (Thank you!) 12 | 13 | Keyboard shortcut preference ctrl-M 14 | 15 | ////////////////////////////////////////////////////////////////*/ 16 | 17 | #target indesign; 18 | 19 | 20 | try{ 21 | var the_document = app.documents.item(0); 22 | // Create a list of master pages 23 | var list_of_master_pages = the_document.masterSpreads.everyItem().name; 24 | 25 | // Set default prefs 26 | var fmaster = 2; 27 | 28 | // Look for and read prefs file 29 | prefsFile = File((Folder(app.activeScript)).parent + "/Find_Master_Memory.txt"); 30 | if(!prefsFile.exists) { 31 | savePrefs(); 32 | } else { 33 | readPrefs(); 34 | } 35 | 36 | // Make the dialog box for selecting the paragraph styles 37 | var the_dialog = app.dialogs.add({name:"Find master"}); 38 | with(the_dialog.dialogColumns.add()){ 39 | with(dialogRows.add()){ 40 | try{ 41 | var find_master = dropdowns.add({stringList:list_of_master_pages, selectedIndex:fmaster}); 42 | }catch(e){ 43 | //new doc 44 | fmaster = 0; 45 | var find_master = dropdowns.add({stringList:list_of_master_pages, selectedIndex:fmaster}); 46 | } 47 | } 48 | } 49 | 50 | var myResult = the_dialog.show(); 51 | 52 | if(myResult == true){ 53 | // Define variables 54 | fmaster = find_master.selectedIndex; 55 | savePrefs(); 56 | var find_master = the_document.masterSpreads.item(find_master.selectedIndex); 57 | var myCounter = app.activeWindow.activePage.documentOffset; 58 | // Find masters 59 | findMaster(find_master, myCounter, the_document.documentPreferences.facingPages); 60 | } else { 61 | //cancel 62 | exit(); 63 | } 64 | 65 | }catch(e){ 66 | alert("OOPS!\rSomething went wrong"); 67 | exit(); 68 | } 69 | 70 | // ------------------------------------------------------ FUNCTIONS ------------------------------------------------------ 71 | 72 | function findMaster(find_master, C, spreads){ 73 | for(var myCounter = C+1; myCounter < the_document.pages.length-1; myCounter++){ 74 | myPage = the_document.pages.item(myCounter); 75 | //if document is in spreads the active window viewpage is always left! 76 | if(spreads == true){ 77 | myPage2 = the_document.pages.item(myCounter-1); 78 | } else { 79 | myPage2 = the_document.pages.item(myCounter); 80 | } 81 | if (myPage.appliedMaster == find_master){ 82 | if(!(app.activeWindow.activePage == myPage || app.activeWindow.activePage == myPage2)){ 83 | //go to and stop 84 | app.activeWindow.activePage = myPage; 85 | exit(); 86 | } 87 | } 88 | } 89 | if(C == 0){ 90 | var message = "Done!\rNothing (else) found"; 91 | } else { 92 | alert("Did not find "+find_master.name+"\rWill search from start of document") 93 | //search from top 94 | findMaster(find_master, 0); 95 | exit(); 96 | } 97 | } 98 | 99 | // function to read prefs from a file 100 | function readPrefs() { 101 | try { 102 | prefsFile.open("r"); 103 | fmaster = Number(prefsFile.readln()); 104 | prefsFile.close(); 105 | } catch(e) { 106 | throwError("Could not read preferences: " + e, false, 2, prefsFile); 107 | } 108 | } 109 | 110 | // function to save prefs to a file 111 | function savePrefs() { 112 | try { 113 | var newPrefs = fmaster; 114 | prefsFile.open("w"); 115 | prefsFile.write(newPrefs); 116 | prefsFile.close(); 117 | }catch(e){ 118 | throwError("Could not save preferences: " + e, false, 2, prefsFile); 119 | } 120 | } -------------------------------------------------------------------------------- /Scripts/Fix_Next_Styles.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | Fixing paragraph style combinations 3 | Version: 1.2 4 | 5 | Script by Thomas Silkjær 6 | http://indesigning.net/ 7 | */ 8 | 9 | var the_document = app.documents.item(0); 10 | 11 | // Create a list of paragraph styles 12 | var list_of_paragraph_styles = []; 13 | var all_paragraph_styles = []; 14 | the_document.paragraphStyles.everyItem().name; 15 | 16 | for(i = 0; i < the_document.paragraphStyles.length; i++) { 17 | list_of_paragraph_styles.push(the_document.paragraphStyles[i].name); 18 | all_paragraph_styles.push(the_document.paragraphStyles[i]); 19 | } 20 | 21 | 22 | for(i = 0; i < the_document.paragraphStyleGroups.length; i++) { 23 | for(b = 0; b < the_document.paragraphStyleGroups[i].paragraphStyles.length; b++) { 24 | list_of_paragraph_styles.push(the_document.paragraphStyleGroups[i].name+'/'+the_document.paragraphStyleGroups[i].paragraphStyles[i].name); 25 | all_paragraph_styles.push(the_document.paragraphStyleGroups[i].paragraphStyles[i]); 26 | } 27 | } 28 | 29 | // Make the dialog box for selecting the paragraph styles 30 | var the_dialog = app.dialogs.add({name:"Fix paragraph style pairs"}); 31 | with(the_dialog.dialogColumns.add()){ 32 | with(dialogRows.add()){ 33 | staticTexts.add({staticLabel:"Find:"}); 34 | } 35 | with(borderPanels.add()){ 36 | var find_first_paragraph = dropdowns.add({stringList:list_of_paragraph_styles, selectedIndex:0}); 37 | staticTexts.add({staticLabel:"followed by"}); 38 | var find_second_paragraph = dropdowns.add({stringList:list_of_paragraph_styles, selectedIndex:0}); 39 | } 40 | with(dialogRows.add()){ 41 | staticTexts.add({staticLabel:"Change:"}); 42 | } 43 | with(borderPanels.add()){ 44 | var change_first_paragraph = dropdowns.add({stringList:list_of_paragraph_styles, selectedIndex:0}); 45 | staticTexts.add({staticLabel:"followed by"}); 46 | var change_second_paragraph = dropdowns.add({stringList:list_of_paragraph_styles, selectedIndex:0}); 47 | } 48 | } 49 | the_dialog.show(); 50 | 51 | // Define paragraph styles 52 | var find_first_paragraph = all_paragraph_styles[find_first_paragraph.selectedIndex]; 53 | var find_second_paragraph = all_paragraph_styles[find_second_paragraph.selectedIndex]; 54 | var change_first_paragraph = all_paragraph_styles[change_first_paragraph.selectedIndex]; 55 | var change_second_paragraph = all_paragraph_styles[change_second_paragraph.selectedIndex]; 56 | 57 | 58 | // Set find grep preferences to find all paragraphs with the first selected paragraph style 59 | app.findChangeGrepOptions.includeFootnotes = false; 60 | app.findChangeGrepOptions.includeHiddenLayers = false; 61 | app.findChangeGrepOptions.includeLockedLayersForFind = false; 62 | app.findChangeGrepOptions.includeLockedStoriesForFind = false; 63 | app.findChangeGrepOptions.includeMasterPages = false; 64 | 65 | app.findGrepPreferences = NothingEnum.nothing; 66 | app.changeGrepPreferences = NothingEnum.nothing; 67 | 68 | app.findGrepPreferences.appliedParagraphStyle = find_first_paragraph; 69 | app.findGrepPreferences.findWhat = "$"; 70 | 71 | //Search the current story 72 | var the_story = app.selection[0].parentStory; 73 | var found_paragraphs = the_story.findGrep(); 74 | 75 | var change_first_list = []; 76 | var change_second_list = []; 77 | 78 | // Loop through the paragraphs and create a list of words and mark them as index words 79 | myCounter = 0; 80 | do { 81 | try { 82 | // Create an object reference to the found paragraph and the next 83 | var first_paragraph = found_paragraphs[myCounter].paragraphs.firstItem(); 84 | var next_paragraph = first_paragraph.paragraphs[-1].insertionPoints[-1].paragraphs[0]; 85 | 86 | // Check if the next paragraph is equal to the find_second_paragraph 87 | if(next_paragraph.appliedParagraphStyle == find_second_paragraph) { 88 | change_first_list.push(first_paragraph); 89 | change_second_list.push(next_paragraph); 90 | } 91 | } catch(err) {} 92 | myCounter++; 93 | } while (myCounter < found_paragraphs.length); 94 | 95 | // Apply paragraph styles 96 | myCounter = 0; 97 | do { 98 | change_first_list[myCounter].appliedParagraphStyle = change_first_paragraph; 99 | change_second_list[myCounter].appliedParagraphStyle = change_second_paragraph; 100 | myCounter++; 101 | } while (myCounter < change_first_list.length); 102 | 103 | alert("Done fixing pairs!"); -------------------------------------------------------------------------------- /Scripts/Fix_ParagraphStyle_Pairs.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | Fixing paragraph style combinations 3 | Version: 1.2 4 | 5 | Script by Thomas Silkjær 6 | http://indesigning.net/ 7 | */ 8 | 9 | var the_document = app.documents.item(0); 10 | 11 | // Create a list of paragraph styles 12 | var list_of_paragraph_styles = []; 13 | var all_paragraph_styles = []; 14 | the_document.paragraphStyles.everyItem().name; 15 | 16 | for(i = 0; i < the_document.paragraphStyles.length; i++) { 17 | list_of_paragraph_styles.push(the_document.paragraphStyles[i].name); 18 | all_paragraph_styles.push(the_document.paragraphStyles[i]); 19 | } 20 | 21 | 22 | for(i = 0; i < the_document.paragraphStyleGroups.length; i++) { 23 | for(b = 0; b < the_document.paragraphStyleGroups[i].paragraphStyles.length; b++) { 24 | list_of_paragraph_styles.push(the_document.paragraphStyleGroups[i].name+'/'+the_document.paragraphStyleGroups[i].paragraphStyles[i].name); 25 | all_paragraph_styles.push(the_document.paragraphStyleGroups[i].paragraphStyles[i]); 26 | } 27 | } 28 | 29 | // Make the dialog box for selecting the paragraph styles 30 | var the_dialog = app.dialogs.add({name:"Fix paragraph style pairs"}); 31 | with(the_dialog.dialogColumns.add()){ 32 | with(dialogRows.add()){ 33 | staticTexts.add({staticLabel:"Find:"}); 34 | } 35 | with(borderPanels.add()){ 36 | var find_first_paragraph = dropdowns.add({stringList:list_of_paragraph_styles, selectedIndex:0}); 37 | staticTexts.add({staticLabel:"followed by"}); 38 | var find_second_paragraph = dropdowns.add({stringList:list_of_paragraph_styles, selectedIndex:0}); 39 | } 40 | with(dialogRows.add()){ 41 | staticTexts.add({staticLabel:"Change:"}); 42 | } 43 | with(borderPanels.add()){ 44 | var change_first_paragraph = dropdowns.add({stringList:list_of_paragraph_styles, selectedIndex:0}); 45 | staticTexts.add({staticLabel:"followed by"}); 46 | var change_second_paragraph = dropdowns.add({stringList:list_of_paragraph_styles, selectedIndex:0}); 47 | } 48 | } 49 | the_dialog.show(); 50 | 51 | // Define paragraph styles 52 | var find_first_paragraph = all_paragraph_styles[find_first_paragraph.selectedIndex]; 53 | var find_second_paragraph = all_paragraph_styles[find_second_paragraph.selectedIndex]; 54 | var change_first_paragraph = all_paragraph_styles[change_first_paragraph.selectedIndex]; 55 | var change_second_paragraph = all_paragraph_styles[change_second_paragraph.selectedIndex]; 56 | 57 | 58 | // Set find grep preferences to find all paragraphs with the first selected paragraph style 59 | app.findChangeGrepOptions.includeFootnotes = false; 60 | app.findChangeGrepOptions.includeHiddenLayers = false; 61 | app.findChangeGrepOptions.includeLockedLayersForFind = false; 62 | app.findChangeGrepOptions.includeLockedStoriesForFind = false; 63 | app.findChangeGrepOptions.includeMasterPages = false; 64 | 65 | app.findGrepPreferences = NothingEnum.nothing; 66 | app.findGrepPreferences.appliedParagraphStyle = find_first_paragraph; 67 | app.findGrepPreferences.findWhat = "$"; 68 | 69 | //Search the current story 70 | var the_story = app.selection[0].parentStory; 71 | var found_paragraphs = the_story.findGrep(); 72 | 73 | var change_first_list = []; 74 | var change_second_list = []; 75 | 76 | // Loop through the paragraphs and create a list of words and mark them as index words 77 | myCounter = 0; 78 | do { 79 | try { 80 | // Create an object reference to the found paragraph and the next 81 | var first_paragraph = found_paragraphs[myCounter].paragraphs.firstItem(); 82 | var next_paragraph = first_paragraph.paragraphs[-1].insertionPoints[-1].paragraphs[0]; 83 | 84 | // Check if the next paragraph is equal to the find_second_paragraph 85 | if(next_paragraph.appliedParagraphStyle == find_second_paragraph) { 86 | change_first_list.push(first_paragraph); 87 | change_second_list.push(next_paragraph); 88 | } 89 | } catch(err) {} 90 | myCounter++; 91 | } while (myCounter < found_paragraphs.length); 92 | 93 | // Apply paragraph styles 94 | myCounter = 0; 95 | do { 96 | change_first_list[myCounter].appliedParagraphStyle = change_first_paragraph; 97 | change_second_list[myCounter].appliedParagraphStyle = change_second_paragraph; 98 | myCounter++; 99 | } while (myCounter < change_first_list.length); 100 | 101 | alert("Done fixing pairs!"); -------------------------------------------------------------------------------- /Scripts/Fix_Paragraph_Endleading.jsx: -------------------------------------------------------------------------------- 1 | if (app.documents.length<1){exit()} 2 | var doc = app.activeDocument; 3 | for (var i=0;i 45) && (posAngle <= 90) ) { 65 | // avoid a reversed width/height 66 | var add90 = app.transformationMatrices.add({counterclockwiseRotationAngle:-90}); 67 | } 68 | 69 | //Create the transformation matrix 70 | var rectTransformationMatrix = app.transformationMatrices.add({counterclockwiseRotationAngle:-rectRot}); 71 | var imgTransformationMatrix = app.transformationMatrices.add({counterclockwiseRotationAngle:rectRot+imgRot}); 72 | // Rotate around its center point 73 | myRect.transform(CoordinateSpaces.pasteboardCoordinates, AnchorPoint.centerAnchor, rectTransformationMatrix); 74 | if(add90) { 75 | myRect.transform(CoordinateSpaces.pasteboardCoordinates, AnchorPoint.centerAnchor, add90); 76 | } 77 | myImg.transform(CoordinateSpaces.pasteboardCoordinates, AnchorPoint.centerAnchor, imgTransformationMatrix); 78 | 79 | myImg.geometricBounds = imgBounds; 80 | } 81 | }catch(e){} //no image 82 | } 83 | 84 | function fit(){ 85 | var oldRuler = myDoc.viewPreferences.rulerOrigin; 86 | myDoc.viewPreferences.rulerOrigin = RulerOrigin.spreadOrigin; 87 | 88 | try { 89 | for(var i=0;i pageWidth*1.75){ 104 | //spread 105 | var bleedBound = new Array(-bleed,-bleed,pageBounds[2]+bleed,pageWidth*2+bleed); 106 | } else { 107 | //page 108 | if(myDoc.documentPreferences.facingPages) { 109 | if(myPage.side == PageSideOptions.RIGHT_HAND){ 110 | var bleedBound = new Array(pageBounds[0]-bleed,pageBounds[1],pageBounds[2]+bleed,pageBounds[3]+bleed); 111 | } else if(myPage.side == PageSideOptions.LEFT_HAND){ 112 | var bleedBound = new Array(pageBounds[0]-bleed,pageBounds[1]-bleed,pageBounds[2]+bleed,pageBounds[3]); 113 | } else { // PageSideOptions.SINGLE_SIDED 114 | var bleedBound = new Array(pageBounds[0]-bleed,pageBounds[1]-bleed,pageBounds[2]+bleed,pageBounds[3]+bleed); 115 | } 116 | } else { 117 | if(mySpread.pages.lastItem().id == myPage.id){ 118 | var bleedBound = new Array(pageBounds[0]-bleed,pageBounds[1],pageBounds[2]+bleed,pageBounds[3]+bleed); 119 | } else if(mySpread.pages.firstItem().id == myPage.id){ 120 | var bleedBound = new Array(pageBounds[0]-bleed,pageBounds[1]-bleed,pageBounds[2]+bleed,pageBounds[3]); 121 | } else { // middle 122 | var bleedBound = new Array(pageBounds[0]-bleed,pageBounds[1],pageBounds[2]+bleed,pageBounds[3]); 123 | } 124 | } 125 | } 126 | myRect.geometricBounds = bleedBound; 127 | } 128 | }catch(e){ alert(e.description)} 129 | myDoc.viewPreferences.rulerOrigin = oldRuler; 130 | } 131 | -------------------------------------------------------------------------------- /Scripts/Frame_2_Spread.jsx: -------------------------------------------------------------------------------- 1 | // Frame_2_Bleed.jsx 2 | // An InDesign CS5+ JavaScript by Bruno Herfst 2012 - 2016 3 | // Version 1.2 4 | 5 | #target indesign 6 | 7 | var myDoc; 8 | var convert_shapes_to_rectangle = true; 9 | var straighten_frames = true; 10 | 11 | main(); 12 | 13 | function main(){ 14 | //Make certain that user interaction (display of dialogs, etc.) is turned on. 15 | app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; 16 | if(app.documents.length != 0){ 17 | myDoc = app.activeDocument; 18 | if(app.selection.length != 0){ 19 | //Get the first item in the selection. 20 | for(var i=0;i= 180) { 66 | var newAngle = myImg.rotationAngle -= 180; 67 | } 68 | 69 | myImg.geometricBounds = imgBounds; 70 | } 71 | 72 | function fit(){ 73 | var oldRuler = myDoc.viewPreferences.rulerOrigin; 74 | myDoc.viewPreferences.rulerOrigin = RulerOrigin.spreadOrigin; 75 | try { 76 | for(var i=0;i= 180) { 66 | var newAngle = myImg.rotationAngle -= 180; 67 | } 68 | 69 | myImg.geometricBounds = imgBounds; 70 | } 71 | 72 | function fit(){ 73 | var oldRuler = myDoc.viewPreferences.rulerOrigin; 74 | myDoc.viewPreferences.rulerOrigin = RulerOrigin.spreadOrigin; 75 | try { 76 | for(var i=0;i=0; i--){ 49 | breakSpread(myCover, myCover.spreads[i]); 50 | } 51 | return true; 52 | } 53 | 54 | function breakSpread(myCover, mySpread){ 55 | var ruleror = myCover.viewPreferences.rulerOrigin; 56 | myCover.viewPreferences.rulerOrigin = RulerOrigin.SPREAD_ORIGIN; 57 | 58 | var mySpreadRectangles = mySpread.rectangles; 59 | var mySpreadOvals = mySpread.ovals; 60 | var mySpreadPolygons = mySpread.polygons; 61 | 62 | var mySpreadPages = mySpread.pages; 63 | var pagesLen = mySpreadPages.length; 64 | var myPages = new Array(); 65 | 66 | for (var page = pagesLen-1; page>=0; page--){ 67 | // Get page bounds including bleed 68 | if(page == 0){ // first 69 | var myFrameBounds = getPageBounds(mySpreadPages[page],3); 70 | } else if (page == pagesLen-1){ 71 | var myFrameBounds = getPageBounds(mySpreadPages[page],1); 72 | } else { 73 | var myFrameBounds = getPageBounds(mySpreadPages[page],2); 74 | } 75 | myPages.push({page: mySpreadPages[page], bounds:myFrameBounds}); 76 | } 77 | if(myPages.length > 1) { 78 | breakFramesTo(myPages,mySpreadRectangles); 79 | breakFramesTo(myPages,mySpreadOvals); 80 | breakFramesTo(myPages,mySpreadPolygons); 81 | } 82 | myCover.viewPreferences.rulerOrigin = ruleror; 83 | return true; 84 | } 85 | 86 | function breakFramesTo(myPages,mySpreadItems){ 87 | for ( i = mySpreadItems.length-1; i >= 0; i-- ) { 88 | var spreadItem = mySpreadItems[i]; 89 | var myLayer = spreadItem.itemLayer; 90 | //make sure layer is unlocked 91 | var myLayerLock = myLayer.locked; 92 | if(myLayerLock){ 93 | myLayer.locked = false; 94 | } 95 | // Check item agains every page 96 | var pagesLen = myPages.length; 97 | for (var j = pagesLen-1; j >= 0; j--){ 98 | var myDupItem = spreadItem.duplicate(); 99 | var rect = myPages[j].page.rectangles.add(myLayer,{geometricBounds:myPages[j].bounds, fillColor:"None", strokeColor:"None"}); 100 | rect.sendToBack(); 101 | try { 102 | rect.intersectPath(myDupItem); 103 | } catch(e) { 104 | // Don't break if it doesn't work out. It's OK. 105 | rect.remove(); 106 | myDupItem.remove(); 107 | // alert(e.description); 108 | } 109 | } 110 | spreadItem.remove(); 111 | //set original lock 112 | if(myLayerLock){ 113 | myLayer.locked = true; 114 | } 115 | } 116 | } 117 | 118 | function getPageBounds(myPage,selector){ 119 | var myBleedBounds = myPage.bounds; //[y1, x1, y2, x2] 120 | 121 | // Add top and bottom bleed 122 | myBleedBounds[0] -= myCoverBleed.Top; 123 | myBleedBounds[2] += myCoverBleed.Bottom; 124 | 125 | // Left and right bleed 126 | switch (selector){ 127 | case 2: 128 | return myBleedBounds; // Return page-bounds with top+bottom bleed 129 | break; 130 | case 3: 131 | myBleedBounds[1] -= myCoverBleed.Left; 132 | return myBleedBounds; 133 | break; 134 | case 1: 135 | myBleedBounds[3] += myCoverBleed.Right; 136 | return myBleedBounds; 137 | break; 138 | default: // Return page-bounds without bleed 139 | return myPage.bounds; 140 | break; 141 | } 142 | } -------------------------------------------------------------------------------- /Scripts/Frame_Splits_Story.jsx: -------------------------------------------------------------------------------- 1 | // Frame Splits Story 2 | 3 | // Same as StorySplitter by FourAces but removed UI 4 | // Automatically unlinks/splits to frame boundry 5 | // Sugested shortcut: Ctr-F 6 | // Bruno Herfst 2018 7 | 8 | /* 9 | ---------------------------------------------------------------------- 10 | StorySplitter 11 | ---------------------------------------------------------------------- 12 | An InDesign CS/CS2/CS3 JavaScript by FourAces 13 | © The Final Touch 2006 14 | Version 3.0.0 15 | 16 | Splits the selected Story to separate Text Frames, while maintaining their contents. 17 | ---------------------------------------------------------------------- 18 | */ 19 | 20 | #target indesign; 21 | 22 | function splitStoryAtFrame( tf ){ 23 | if (tf.previousTextFrame !== null){ 24 | var myBfBreakFrame = tf.previousTextFrame; 25 | var myAfBreakFrame = tf; 26 | var myBreakStory = myBfBreakFrame.parentStory; 27 | tf.previousTextFrame = null; 28 | if(myBfBreakFrame.overflows == true){ 29 | var myOversetText = myBreakStory.texts.itemByRange(myBfBreakFrame.insertionPoints[-1],myBreakStory.insertionPoints[-1]); 30 | myOversetText.select(); 31 | app.cut(); 32 | app.select(myAfBreakFrame.insertionPoints[0]); 33 | app.paste(); 34 | } 35 | }; 36 | if (tf.nextTextFrame !== null) { 37 | var myBfBreakFrame = tf; 38 | var myAfBreakFrame = tf.nextTextFrame; 39 | var myBreakStory = myBfBreakFrame.parentStory; 40 | tf.nextTextFrame = null; 41 | if(myBfBreakFrame.overflows == true){ 42 | var myOversetText = myBreakStory.texts.itemByRange(myBfBreakFrame.insertionPoints[-1],myBreakStory.insertionPoints[-1]); 43 | myOversetText.select(); 44 | app.cut(); 45 | app.select(myAfBreakFrame.insertionPoints[0]); 46 | app.paste(); 47 | } 48 | }; 49 | }; 50 | 51 | if(app.documents.length != 0){ 52 | var mySelection = app.activeDocument.selection; 53 | var myTextFrames = []; 54 | var returnPage = mySelection[0].parentPage; 55 | 56 | // Collect textFrames in selection 57 | for (var i = 0; i < mySelection.length; i++) { 58 | if(mySelection[i].constructor.name === "TextFrame"){ 59 | myTextFrames.push(mySelection[i]); 60 | }; 61 | }; 62 | 63 | if(myTextFrames.length > 0){ 64 | for (var i = 0; i < myTextFrames.length; i++) { 65 | splitStoryAtFrame( myTextFrames[i] ); 66 | }; 67 | app.activeWindow.activePage = returnPage; 68 | alert("Done!"); 69 | } else { 70 | alert("Please select at least one Text Frame to split."); 71 | } 72 | } else { 73 | alert("No Active Document Found.\nPlease open an InDesign document and select a Text Frame to split."); 74 | }; 75 | -------------------------------------------------------------------------------- /Scripts/Frame_Splits_Story_UI.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | ---------------------------------------------------------------------- 3 | StorySplitter 4 | ---------------------------------------------------------------------- 5 | An InDesign CS/CS2/CS3 JavaScript by FourAces 6 | © The Final Touch 2006 7 | Version 3.0.0 8 | 9 | Splits the selected Story to separate Text Frames, while maintaining their contents. 10 | ---------------------------------------------------------------------- 11 | */ 12 | 13 | // Adjusted by Bruno Herfst to suit needs 14 | // 1. Return to selected frame page 15 | // Don't have time for this now but it would be good if there was an option for style based splitting. 16 | 17 | #target indesign; 18 | 19 | var myScriptVer = "3.0"; 20 | 21 | function mySplitAll() { 22 | for(var i = 0; i < myStoryFramesCount; i++){ 23 | myTextFrames[i].duplicate(); 24 | } 25 | for(var i = 0; i < myStoryFramesCount; i++){ 26 | myTextFrames[i].remove(); 27 | } 28 | } 29 | 30 | function mySplitBefore(){ 31 | if(mySelection[0].previousTextFrame == null){ 32 | alert("Unable to break thread.\nThe selected Text Frame is the FIRST text frame of the thread."); 33 | } else { 34 | var myBfBreakFrame = mySelection[0].previousTextFrame; 35 | var myAfBreakFrame = mySelection[0]; 36 | var myBreakStory = myBfBreakFrame.parentStory; 37 | mySelection[0].previousTextFrame = null; 38 | if(myBfBreakFrame.overflows == true){ 39 | var myOversetText = myBreakStory.texts.itemByRange(myBfBreakFrame.insertionPoints[-1],myBreakStory.insertionPoints[-1]); 40 | myOversetText.select(); 41 | app.cut(); 42 | app.select(myAfBreakFrame.insertionPoints[0]); 43 | app.paste(); 44 | } 45 | } 46 | } 47 | 48 | 49 | function mySplitAfter() { 50 | if (mySelection[0].nextTextFrame == null) { 51 | alert("Unable Break Thread.\nThe selected Text Frame is the LAST text frame of the thread."); 52 | } else { 53 | var myBfBreakFrame = mySelection[0]; 54 | var myAfBreakFrame = mySelection[0].nextTextFrame; 55 | var myBreakStory = myBfBreakFrame.parentStory; 56 | mySelection[0].nextTextFrame = null; 57 | if(myBfBreakFrame.overflows == true){ 58 | var myOversetText = myBreakStory.texts.itemByRange(myBfBreakFrame.insertionPoints[-1],myBreakStory.insertionPoints[-1]); 59 | myOversetText.select(); 60 | app.cut(); 61 | app.select(myAfBreakFrame.insertionPoints[0]); 62 | app.paste(); 63 | } 64 | } 65 | } 66 | 67 | //--------------------------------------------------------------------- 68 | 69 | if(app.documents.length != 0){ 70 | var mySelection = app.activeDocument.selection; 71 | if(mySelection.length != 0){ 72 | myObjectType = mySelection[0].constructor.name; 73 | if(myObjectType == "TextFrame"){ 74 | var returnPage = mySelection[0].parentPage; 75 | //The Interface Dialog 76 | var myDialog = app.dialogs.add({name:"Story Splitter v"+ myScriptVer}); 77 | with(myDialog){ 78 | with(dialogColumns.add()){ 79 | with (dialogRows.add()){ 80 | with(borderPanels.add()){ 81 | var mySplitOptions = radiobuttonGroups.add(); 82 | with(mySplitOptions){ 83 | radiobuttonControls.add({staticLabel:"Split All Frames"}); 84 | radiobuttonControls.add({staticLabel:"Split Before Selected Frame", checkedState:true}); 85 | radiobuttonControls.add({staticLabel:"Split After Selected Frame"}); 86 | } 87 | } 88 | } 89 | with (dialogRows.add()){ 90 | staticTexts.add({staticLabel:"© The Final Touch"}); 91 | } 92 | } 93 | 94 | var myResult = myDialog.show({name:"SplitOptions"}); 95 | if(myResult == true){ 96 | var myStory = mySelection[0].parentStory; 97 | if(app.version.split(".")[0] >= 5){ 98 | var myTextFrames = myStory.textContainers; 99 | } else { 100 | var myTextFrames = myStory.textFrames; 101 | } 102 | var myStoryFramesCount = myTextFrames.length; 103 | if(myStoryFramesCount > 1){ 104 | for(f = 0; f < myStoryFramesCount; f++){ 105 | if (mySelection[0] == myStory.textFrames[f]){ 106 | var myTextFrame = f; 107 | } 108 | } 109 | switch(mySplitOptions.selectedButton){ 110 | case 0: 111 | mySplitAll(); 112 | break; 113 | case 1: 114 | mySplitBefore(); 115 | break; 116 | case 2: 117 | mySplitAfter(); 118 | break; 119 | } 120 | app.activeWindow.activePage = returnPage; 121 | alert("Done!"); 122 | } else { 123 | alert("Are You Kidding Me?!\nThe Story you selected has only ONE text frame."); 124 | } 125 | } 126 | } 127 | } else { 128 | alert("Wrong Selection\nYou selected the wrong type of object. Please select a Text Frame."); 129 | } 130 | } else { 131 | alert("No Selection Made.\nPlease select a Story to split."); 132 | } 133 | } else { 134 | alert("No Active Document Found.\nPlease open an InDesign document and select a Story to split."); 135 | } // EOF 136 | 137 | -------------------------------------------------------------------------------- /Scripts/Frames_2_Bleed.jsx: -------------------------------------------------------------------------------- 1 | // Document_Frames_2_Bleed.jsx 2 | // Based on Frame_2_Bleed.jsx 3 | // An InDesign JavaScript by Bruno Herfst 2012 4 | // Handy to run after multi page importer. 5 | // Version 1.0 6 | 7 | #target indesign 8 | main(); 9 | 10 | var myDoc, myRects, len; 11 | 12 | function main(){ 13 | //Make certain that user interaction (display of dialogs, etc.) is turned on. 14 | app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; 15 | if(app.documents.length != 0){ 16 | myDoc = app.activeDocument; 17 | myRects = myDoc.rectangles; //image frames are rectangles 18 | len = myRects.length; 19 | fit(); 20 | }else{ 21 | alert("Please open a document and try again."); 22 | } 23 | alert("Resized "+len+" rectangles!"); 24 | } 25 | 26 | function fit(){ 27 | var oldRuler = myDoc.viewPreferences.rulerOrigin; 28 | myDoc.viewPreferences.rulerOrigin = RulerOrigin.spreadOrigin; 29 | for(var i=0;i pageWidth*1.75){ 42 | //spread 43 | var bleedBound = new Array(-bleed,-bleed,pageBounds[2]+bleed,pageWidth*2+bleed); 44 | } else { 45 | //page 46 | if(myPage.side == PageSideOptions.RIGHT_HAND){ 47 | var bleedBound = new Array(pageBounds[0]-bleed,pageBounds[1],pageBounds[2]+bleed,pageBounds[3]+bleed); 48 | } else if(myPage.side == PageSideOptions.LEFT_HAND){ 49 | var bleedBound = new Array(pageBounds[0]-bleed,pageBounds[1]-bleed,pageBounds[2]+bleed,pageBounds[3]); 50 | } else { // PageSideOptions.SINGLE_SIDED 51 | var bleedBound = new Array(pageBounds[0]-bleed,pageBounds[1]-bleed,pageBounds[2]+bleed,pageBounds[3]+bleed); 52 | } 53 | } 54 | myRect.geometricBounds = bleedBound; 55 | myDoc.viewPreferences.rulerOrigin = oldRuler; 56 | } 57 | } -------------------------------------------------------------------------------- /Scripts/Frames_Merge.jsx: -------------------------------------------------------------------------------- 1 | // Merge_TextFrames.jsx 2 | // Version 1.0 3 | 4 | // Bruno Herfst 2018 5 | 6 | 7 | var Settings = { 8 | redrawFrame : true, 9 | addLineFeed : true // if redrawFrame === True 10 | } 11 | 12 | function main() { 13 | 14 | var textframes = []; 15 | 16 | for (i = 0; i < app.selection.length; i++) { 17 | if( app.selection[i].constructor.name === "TextFrame" ) { 18 | textframes.push( app.selection[i] ) 19 | } 20 | } 21 | 22 | if( textframes.length === 0) { 23 | alert("Select some textframes before running this script"); 24 | return; 25 | } 26 | 27 | // Sort textframes on reading order 28 | textframes.sort(function(a, b) { 29 | return a.geometricBounds[1] - b.geometricBounds[1]; 30 | }); 31 | 32 | textframes.sort(function(a, b) { 33 | return a.geometricBounds[0] - b.geometricBounds[0]; 34 | }); 35 | 36 | var bounds = textframes[0].geometricBounds; //[y1, x1, y2, x2] 37 | 38 | for(var i = textframes.length - 1; i > 0; i--){ 39 | if( Settings.redrawFrame && Settings.addLineFeed ) textframes[i].insertionPoints[0].contents = "\n"; 40 | // Make sure frames are linked 41 | try { 42 | textframes[i-1].nextTextFrame = textframes[i]; 43 | } catch( props ) { 44 | // no probs bro! 45 | } 46 | var frameBounds = textframes[i].geometricBounds; 47 | if(frameBounds[0] < bounds[0]) bounds[0] = frameBounds[0]; 48 | if(frameBounds[1] < bounds[1]) bounds[1] = frameBounds[1]; 49 | if(frameBounds[2] > bounds[2]) bounds[2] = frameBounds[2]; 50 | if(frameBounds[3] > bounds[3]) bounds[3] = frameBounds[3]; 51 | if( Settings.redrawFrame ) textframes[i].remove(); 52 | }; 53 | 54 | if( Settings.redrawFrame ) textframes[0].geometricBounds = bounds; 55 | } 56 | 57 | main(); 58 | -------------------------------------------------------------------------------- /Scripts/Generate_Auto_CharacterStyles.jsx: -------------------------------------------------------------------------------- 1 | //DESCRIPTION: Jongware's PrepText 2 | 3 | if (app.activeDocument.selection[0].constructor.name != "InsertionPoint") 4 | { 5 | alert ("Cursor in "+app.activeDocument.selection[0].constructor.name+"\nPlease put the cursor into a text frame"); 6 | exit(0); 7 | } 8 | 9 | var myMaximumValue = 63; 10 | var myProgressBarWidth = 384; 11 | var myIncrement = myMaximumValue/myProgressBarWidth; 12 | myCreateProgressPanel(myMaximumValue, myProgressBarWidth); 13 | 14 | myProgressPanel.myProgressBar.value = 0; 15 | myCreateProgressPanel(100, 400); 16 | myProgressPanel.show(); 17 | 18 | for (b=0; b<2; b++) 19 | { 20 | for (i=0; i<2; i++) 21 | { 22 | for (s=0; s<2; s++) 23 | { 24 | for (u=0; u<2; u++) 25 | { 26 | // Don't process strikeout 27 | for (k=0; k<1; k++) 28 | { 29 | for (c=0; c<3; c++) 30 | { 31 | if (b+i+s+u+k+c) 32 | { 33 | myProgressPanel.myProgressBar.value = 32*b+16*i+8*s+4*u+2*k+c; 34 | findAttr (b, i, s, false, u, /*k*/false, c, ""); 35 | if (s) 36 | findAttr (b, i, false, s, u, /*k*/false, c, ""); 37 | } 38 | } 39 | } 40 | } 41 | } 42 | } 43 | } 44 | myProgressPanel.hide(); 45 | 46 | exit(0); 47 | 48 | function myCreateProgressPanel(myMaximumValue, myProgressBarWidth) 49 | { 50 | myProgressPanel = new Window('window', 'Prepping text'); 51 | with(myProgressPanel) 52 | { 53 | myProgressPanel.myProgressBar = add('progressbar', [12, 12, myProgressBarWidth, 24], 0, myMaximumValue); 54 | } 55 | } 56 | 57 | function findAttr (bold, italic, superscript, subscript, underline, strikeout, small_all_caps, StyleName) 58 | { 59 | app.findTextPreferences = NothingEnum.nothing; 60 | app.changeTextPreferences = NothingEnum.nothing; 61 | app.findTextPreferences.appliedCharacterStyle = app.activeDocument.characterStyles[0]; // "[None]" 62 | 63 | app.findTextPreferences.fontStyle = "Regular"; 64 | app.findTextPreferences.position = Position.NORMAL; 65 | app.findTextPreferences.capitalization = Capitalization.NORMAL; 66 | app.findTextPreferences.underline = false; 67 | app.findTextPreferences.strikeThru = false; 68 | 69 | if (bold) 70 | { 71 | if (italic) 72 | app.findTextPreferences.fontStyle = "Bold Italic"; 73 | else 74 | app.findTextPreferences.fontStyle = "Bold"; 75 | } else 76 | { 77 | if (italic) 78 | app.findTextPreferences.fontStyle = "Italic"; 79 | } 80 | if (superscript) 81 | app.findTextPreferences.position = Position.SUPERSCRIPT; 82 | 83 | if (subscript) 84 | app.findTextPreferences.position = Position.SUBSCRIPT; 85 | 86 | if (underline) 87 | app.findTextPreferences.underline = true; 88 | if (strikeout) 89 | app.findTextPreferences.strikeThru = true; 90 | 91 | if (small_all_caps == 1) 92 | app.findTextPreferences.capitalization = Capitalization.SMALL_CAPS; 93 | if (small_all_caps == 2) 94 | app.findTextPreferences.capitalization = Capitalization.ALL_CAPS; 95 | 96 | foundItems = app.activeDocument.selection[0].parent.findText(); 97 | 98 | if (foundItems.length > 0) 99 | { 100 | if (StyleName == "") 101 | { 102 | // Make up a name 103 | if (bold) 104 | StyleName = "Bold"; 105 | if (italic) 106 | { 107 | if (bold) 108 | StyleName = "Bold Italic"; 109 | else 110 | StyleName = "Italic"; 111 | } 112 | if (superscript) 113 | { 114 | if (StyleName) StyleName += " + "; 115 | StyleName += "Super"; 116 | } 117 | if (subscript) 118 | { 119 | if (StyleName) StyleName += " + "; 120 | StyleName += "Sub"; 121 | } 122 | if (underline) 123 | { 124 | if (StyleName) StyleName += " + "; 125 | StyleName += "Underline"; 126 | } 127 | if (strikeout) 128 | { 129 | if (StyleName) StyleName += " + "; 130 | StyleName += "Stkout"; 131 | } 132 | if (small_all_caps == 1) 133 | { 134 | if (StyleName) StyleName += " + "; 135 | StyleName += "Scaps"; 136 | } 137 | if (small_all_caps == 2) 138 | { 139 | if (StyleName) StyleName += " + "; 140 | StyleName += "Caps"; 141 | } 142 | try 143 | { 144 | cstyle = app.activeDocument.characterStyles.add({name:StyleName}); // , fontStyle:app.findTextPreferences.fontStyle, underline:app.findTextPreferences.underline, strikeThru:app.findTextPreferences.strikeThru, position:app.findTextPreferences.position, capitalization:app.findTextPreferences.capitalization}); 145 | if (bold || italic) cstyle.fontStyle = app.findTextPreferences.fontStyle; 146 | if (superscript || subscript) cstyle.position = app.findTextPreferences.position; 147 | if (underline) cstyle.underline = app.findTextPreferences.underline; 148 | if (strikeout) cstyle.strikeThru = app.findTextPreferences.strikeThru; 149 | if (small_all_caps) cstyle.capitalization = app.findTextPreferences.capitalization; 150 | } catch (e) 151 | { 152 | } 153 | } 154 | app.changeTextPreferences.appliedCharacterStyle = StyleName; 155 | app.activeDocument.selection[0].parent.changeText (false); 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /Scripts/Generate_Rectangle_2_SpreadBleed.jsx: -------------------------------------------------------------------------------- 1 | /*//////////////////////////////////////////////////////////////// 2 | 3 | New_Rectangle_2_SpreadBleed.jsx 4 | Version 1 5 | Tested in InDesign CC 6 | 7 | This scripts adds a new rectangle frame covering the current spread including bleed. 8 | 9 | Bruno Herfst 2015 10 | 11 | ////////////////////////////////////////////////////////////////*/ 12 | 13 | #target indesign; 14 | 15 | try{ 16 | var DOC = app.activeDocument; 17 | var SPREAD = app.activeWindow.activeSpread; 18 | main(); 19 | }catch(e){ 20 | alert("OOPS!\n" + e.description); 21 | exit(); 22 | } 23 | 24 | // ------------------------------------------------------ FUNCTIONS ------------------------------------------------------ 25 | 26 | function main(){ 27 | //alert(SPREAD.pages.length); 28 | var myRect = addRectangle(SPREAD.pages[0], "NEW_RECT_48655"); 29 | app.select(fit2SpreadBleed(myRect)); 30 | } 31 | 32 | function addRectangle( PAGE, LABEL ){ 33 | var myRect = PAGE.rectangles.add(); 34 | myRect.label = LABEL; 35 | return myRect; 36 | } 37 | 38 | function fit2SpreadBleed(myRect){ 39 | var myPage = myRect.parentPage; 40 | var mySpread = myPage.parent; 41 | var firstPage = mySpread.pages[0]; 42 | var lastPage = mySpread.pages[mySpread.pages.length-1]; 43 | 44 | //check bounds 45 | var rectBounds = myRect.geometricBounds; 46 | 47 | var firstPageBounds = firstPage.bounds; //in the format [y1, x1, y2, x2], top-left and bottom-right 48 | var lastPageBounds = lastPage.bounds; 49 | 50 | var pageBounds = [firstPageBounds[0],firstPageBounds[1],lastPageBounds[2],lastPageBounds[3]]; 51 | var pageWidth = pageBounds[3]-pageBounds[1]; 52 | 53 | var bleedBot = DOC.documentPreferences.documentBleedBottomOffset; 54 | var bleedLef = DOC.documentPreferences.documentBleedInsideOrLeftOffset; 55 | var bleedRig = DOC.documentPreferences.documentBleedOutsideOrRightOffset; 56 | var bleedTop = DOC.documentPreferences.documentBleedTopOffset; 57 | 58 | var bleedBound = new Array(pageBounds[0]-bleedTop,pageBounds[1]-bleedLef,pageBounds[2]+bleedBot,pageBounds[3]+bleedRig); 59 | 60 | myRect.geometricBounds = bleedBound; 61 | 62 | return myRect; 63 | } 64 | -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/100.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/100.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/101.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/101.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/102.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/102.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/103.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/103.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/104.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/104.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/105.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/105.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/106.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/106.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/107.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/107.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/108.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/108.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/109.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/109.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/110.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/110.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/111.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/111.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/112.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/112.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/113.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/113.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/114.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/114.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/115.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/115.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/116.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/116.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/117.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/117.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/118.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/118.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/119.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/119.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/120.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/120.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/121.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/121.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/122.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/122.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/32.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/32.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/48.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/48.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/49.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/49.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/50.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/50.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/51.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/51.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/52.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/52.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/53.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/53.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/54.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/54.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/55.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/55.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/56.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/56.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/57.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/57.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/59.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/59.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/65533.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/65533.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/97.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/97.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/98.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/98.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/99.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/99.psd -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/test.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/test.eps -------------------------------------------------------------------------------- /Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/test.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GitBruno/Novelty/8798aa63c52228f2b5807ab0b02f1c9782b82525/Scripts/Glyph_Replacer_Fonts/AmericanTypewriter-CondensedLight-67pt/test.psd -------------------------------------------------------------------------------- /Scripts/Images_Unembed_All.jsx: -------------------------------------------------------------------------------- 1 | //DESCRIPTION: 'Unpaste' pasted images 2 | // Peter Kahrel -- www.kahrel.plus.com 3 | 4 | // Pasted images (images without a link in the Links panel) 5 | // are written on disk in the selected directory 6 | // Images can be linked. 7 | 8 | (function () { 9 | 10 | function scriptPath () { 11 | try { 12 | return app.activeScript; 13 | } catch (e) { 14 | return File (e.fileName); 15 | } 16 | } 17 | 18 | function saveData (obj) { 19 | var f = File (scriptPath().fullName.replace (/\.jsx?(bin)?$/, '.txt')); 20 | f.open ('w'); 21 | f.write (obj.toSource()); 22 | f.close (); 23 | } 24 | 25 | function getPrevious () { 26 | var f = File (scriptPath().fullName.replace (/\.jsx?(bin)?$/, '.txt')); 27 | if (f.exists){ 28 | return $.evalFile(f); 29 | } 30 | return { 31 | format: 'EPS', 32 | create_links: true, 33 | folder: app.documents[0].filePath+'/' 34 | }; 35 | } 36 | 37 | function get_outfolder (dir) { 38 | //return Folder (app.documents[0].fullName.path); 39 | var e; 40 | try { 41 | var f = Folder (dir).selectDlg(); 42 | } catch (e) { 43 | alert (e.message); 44 | exit(); 45 | } 46 | if (f === null) exit(); 47 | return f; 48 | } 49 | 50 | function pasted_graphics (array) { 51 | for (var i = array.length-1; i >= 0; i--) { 52 | if (array[i].itemLink == null) { 53 | return true; 54 | } 55 | } 56 | return false; 57 | } 58 | 59 | function get_format (previous) { 60 | var export_enums = [ExportFormat.EPS_TYPE, ExportFormat.JPG, ExportFormat.PNG_FORMAT]; 61 | var w = new Window ('dialog {text: "Save pasted images", alignChildren: "left", properties: {closeButton: false}}'); 62 | var g1 = w.add ('panel {orientation: "row"}'); 63 | g1.add ('statictext', undefined, 'Export format: '); 64 | var format = g1.add ('dropdownlist', [0,0,160,22], ['EPS', 'JPEG', 'PNG']); 65 | var link = w.add ('checkbox {text: "Create links"}'); 66 | var buttons = w.add ('group {alignment: "right"}'); 67 | buttons.add ('button', undefined, 'OK', {name: 'ok'}); 68 | buttons.add ('button', undefined, 'Cancel', {name: 'cancel'}); 69 | 70 | format.selection = format.find (previous.format); 71 | link.value = previous.create_links; 72 | 73 | if (w.show () == 2) { 74 | exit(); 75 | } 76 | 77 | var o = { 78 | format: format.selection.text, 79 | enum_type: export_enums [format.selection.index], 80 | create_links: link.value 81 | }; 82 | w.close(); 83 | return o; 84 | } 85 | 86 | //------------------------------------------------------------------------------------------------------------------------------------------------- 87 | 88 | function scratch () { 89 | var d = app.documents.add ({visible: true, zeroPoint: [0,0]}); 90 | d.pages[0].marginPreferences.properties = {top: 0, left: 0, bottom: 0, right: 0}; 91 | return d; 92 | } 93 | 94 | function export_as (ExportFormat, im, f) { 95 | var gb = im.parent.geometricBounds; 96 | var d = scratch(); 97 | try { 98 | var dupl = im.parent.duplicate (d.pages[0]); 99 | if (!(dupl instanceof Rectangle)) { 100 | dupl.convertShape (ConvertShapeOptions.CONVERT_TO_RECTANGLE); 101 | } 102 | dupl.clearTransformations(); 103 | dupl.images[0].clearTransformations(); 104 | dupl.images[0].fit (FitOptions.FRAME_TO_CONTENT); 105 | 106 | gb = dupl.geometricBounds; 107 | d.documentPreferences.properties = { 108 | pageHeight: gb[2] - gb[0], 109 | pageWidth: gb[3] - gb[1] 110 | } 111 | 112 | dupl.move (d.pages[0]); 113 | dupl.move ([0, 0]); 114 | dupl.move (d.pages[0]); 115 | dupl.exportFile (ExportFormat, f); 116 | } catch (_) { 117 | } finally { 118 | d.close (SaveOptions.no); 119 | } 120 | } 121 | 122 | //----------------------------------------------------------------------------------------------------------------------------------------- 123 | 124 | 125 | function unembed_images () { 126 | var previous = getPrevious(); 127 | var doc = app.documents[0]; 128 | var outfolder = get_outfolder(previous.folder); 129 | if (doc.saved) { 130 | var outname = outfolder + '/' + doc.name.replace (/\.indd$/, '_'); 131 | } else { 132 | var outname = outfolder + '/untitled___'; 133 | } 134 | var image_file, n = 0, g = doc.allGraphics; 135 | if (pasted_graphics(g)) { 136 | var export_data = get_format (previous); 137 | } 138 | for (var i = g.length-1; i > -1; i--) { 139 | if (g[i].itemLink == null) { 140 | image_file = File (outname + (n++) + '.' + export_data.format); 141 | export_as(export_data.enum_type, g[i], image_file); 142 | if (export_data.create_links) { 143 | g[i].parent.place (image_file); 144 | } else { 145 | g[i].parent.remove (); 146 | } 147 | } else if (g[i].itemLink.status === LinkStatus.linkEmbedded) { 148 | g[i].itemLink.unembed(outfolder); 149 | } 150 | } 151 | 152 | saveData ({ 153 | folder: outfolder, 154 | format: export_data.format, 155 | create_links: export_data.create_links 156 | }); 157 | 158 | } 159 | 160 | //------------------------------------------------------------------------------------------------------------------- 161 | 162 | if (app.documents.length === 0) { 163 | alert ('Open a document.'); exit(); 164 | } 165 | unembed_images(); 166 | 167 | }()); -------------------------------------------------------------------------------- /Scripts/Import_Fore_Edge_Bleed.jsx: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Fore_Edge_Bleeder.jsx 4 | // An InDesign javascript 5 | // Place selected files in outside margin 6 | // 7 | // Bruno Herfst 2011 8 | // 9 | ////////////////////////////////////////////////////////////////////////////////////////////////// 10 | 11 | #target InDesign; 12 | 13 | try{ 14 | // Global variables 15 | var selectedLayer, myLoopImages = false, myInnerBleed = 4, myMultiply = true, 16 | myDoc = app.activeDocument, 17 | list_of_pages = myDoc.pages.everyItem().name, 18 | myFiles = File.openDialog("Select files to place:", "", true); 19 | 20 | // we are going to place the same image on both sides of the page 21 | // this ensures a sharp image on bookblock 22 | if(myFiles.length*2 < list_of_pages.length+1){ //just in case document is uneven 23 | // Save and set preferences 24 | var oldRuler = myDoc.viewPreferences.rulerOrigin; 25 | myDoc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin; 26 | //set rules to mm 27 | 28 | // Prep dialog 29 | var list_of_layers = myDoc.layers.everyItem().name; 30 | list_of_layers.push("[New Layer]"); 31 | 32 | myDisplayDialog(); 33 | }else{ 34 | var diff = myFiles.length*2 - list_of_pages.length; 35 | alert("Too many images!\nPlease add "+diff+" pages"); 36 | exit(); 37 | } 38 | 39 | } catch(err) { 40 | var txt=err.description; 41 | alert(txt); 42 | exit(); 43 | } 44 | 45 | ///////////////////////////////////////////////// F U N C T I O N S ///////////////////////////////////////////////// 46 | 47 | //dialog 48 | function myDisplayDialog(){ 49 | var myDialog = app.dialogs.add({name:"BookArt"}); 50 | with(myDialog.dialogColumns.add()){ 51 | with(dialogRows.add()){ 52 | with(dialogColumns.add()){ 53 | staticTexts.add({staticLabel:"Place images on layer:"}); 54 | } 55 | with(dialogColumns.add()){ 56 | var mySelectedLayer = dropdowns.add({stringList:list_of_layers, selectedIndex:0}); 57 | } 58 | } 59 | //break// 60 | with(dialogRows.add()){ 61 | with(dialogColumns.add()){ 62 | staticTexts.add({staticLabel:"Visibility on page:"}); 63 | } 64 | with(dialogColumns.add()){ 65 | var myInputBleed=mm2pt(myInnerBleed); 66 | var myInnerBleedField = measurementEditboxes.add({editUnits:MeasurementUnits.MILLIMETERS,editValue:myInputBleed}); 67 | } 68 | } 69 | //break// 70 | var diff = list_of_pages.length-(myFiles.length*2); 71 | if(diff>0){ 72 | with(borderPanels.add()){ 73 | with(dialogColumns.add()){ 74 | staticTexts.add({staticLabel:"You have "+diff+" pages left:"}); 75 | } 76 | with(dialogColumns.add()){ 77 | var myLoopImagesCheckbox = checkboxControls.add({staticLabel:"Loop images", checkedState:true}); 78 | } 79 | } 80 | } 81 | var myResult = myDialog.show(); 82 | 83 | if(myResult == true){ 84 | if (mySelectedLayer.selectedIndex == list_of_layers.length-1){ 85 | selectedLayer = myDoc.layers.add(); 86 | } else { 87 | selectedLayer = myDoc.layers[mySelectedLayer.selectedIndex]; 88 | } 89 | myInnerBleed = pt2mm(myInnerBleedField.editValue); 90 | try{ 91 | myLoopImages = myLoopImagesCheckbox.checkedState; 92 | } catch(err){ 93 | myLoopImages = false; 94 | } 95 | myDialog.destroy(); 96 | placeImages(); 97 | restoreOriginalSettings(); 98 | alert("Done!"); 99 | exit(); 100 | } else { 101 | myDialog.destroy(); 102 | exit(); 103 | } 104 | } 105 | } 106 | //end dialog 107 | 108 | function mm2pt(myMmNum){ 109 | //1 millimetre = 2.83464567 PostScript points 110 | return myMmNum*2.83464567; 111 | } 112 | function pt2mm(myMmNum){ 113 | //1 millimetre = 2.83464567 PostScript points 114 | return myMmNum/2.83464567; 115 | } 116 | 117 | 118 | 119 | function placeImages(){ 120 | var myImages = myFiles.slice();//array 121 | for (var i=0; i0){ 19 | var items = pages[i].pageItems.everyItem().getElements(); 20 | if(emptyOption==0){ 21 | if(items.length>0){changeMaster=false} 22 | } else { 23 | for(var j=0;j= first && folio <= last) { 40 | return docs[i].fullName; 41 | } 42 | } 43 | return null; 44 | } 45 | 46 | 47 | function bringToFront (doc) { 48 | if (!app.documents.item(doc.name).isValid) { 49 | app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT; 50 | app.open (doc); 51 | app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL; 52 | } else { 53 | app.activeDocument = app.documents.item(doc.name); 54 | } 55 | return app.documents[0]; 56 | } 57 | 58 | function getPages () { 59 | var p = app.documents[0].pages.everyItem().name; 60 | p.push ('-'); 61 | var m = app.documents[0].masterSpreads.everyItem().name; 62 | return p.concat (m); 63 | } 64 | 65 | 66 | function getActivePage () { 67 | var page = app.windows[0].activePage; 68 | if (page.parent instanceof MasterSpread) { 69 | return page.parent.name; 70 | } 71 | return page.name; 72 | } 73 | 74 | 75 | function goToPage (folio) { 76 | // Master spread? 77 | if (folio.indexOf('-') > -1 && app.documents[0].masterSpreads.item(folio).isValid) { 78 | app.windows[0].activeSpread = app.documents[0].masterSpreads.item(folio); 79 | return; 80 | } 81 | // Current document? 82 | try { 83 | app.windows[0].activePage = app.documents[0].pages.item(folio); 84 | return; 85 | } catch (_) { 86 | } 87 | // Maybe in a different document 88 | if (app.books.length > 0) { 89 | var doc = findDocument (Number(folio)); 90 | if (doc !== null) { 91 | bringToFront (doc); 92 | app.windows[0].activePage = app.documents[0].pages.item(folio); 93 | return; 94 | } 95 | } 96 | alert ('Can\'t find that page or master spread'); 97 | } 98 | 99 | function main () { 100 | var previous = getPrevious(); 101 | var w = new Window ('dialog {text: "Go to page", orientation: "row", alignChildren: "top", properties: {closeButton: false}}'); 102 | try {w. location = previous.location} catch(_){}; 103 | w.add ('statictext {text: "Page:"}'); 104 | 105 | //w.list = w.add ('dropdownlist', undefined, getPages()); 106 | var names = getPages(); 107 | w.main = w.add ('group'); 108 | w.main.group = w.main.add ('group {alignChildren: "left", orientation: "stack"}'); 109 | if (File.fs != 'Windows') { 110 | w.list = w.main.group.add ('dropdownlist', [0,0,160,20], names); 111 | w.input = w.main.group.add ('edittext', [0,0,140,20]); 112 | } else { 113 | w.input = w.main.group.add ('edittext', [0,0,140,20]); 114 | w.list = w.main.group.add ('dropdownlist', [0,0,160,20], names); 115 | } 116 | 117 | w.buttons = w.add ('group {orientation: "column"}'); 118 | w.buttons.add ('button {text: "OK"}'); 119 | w.buttons.add ('button {text: "Cancel"}'); 120 | 121 | w.list.onChange = function () { 122 | w.input.text = w.list.selection.text; 123 | w.input.active = true; 124 | } 125 | 126 | w.input.onChange = function () { 127 | w.list.selection.text = w.input.text; 128 | w.input.active = true; 129 | } 130 | 131 | var pg = getActivePage(); 132 | w.input.text = pg; 133 | w.list.selection = w.list.find (pg); 134 | w.input.active = true; 135 | 136 | if (w.show() == 1) { 137 | saveData ({location: [w.location.x, w.location.y]}); 138 | goToPage (w.list.selection.text); 139 | } 140 | } 141 | 142 | if (app.documents.length > 0) { 143 | main (); 144 | } 145 | 146 | }()); 147 | -------------------------------------------------------------------------------- /Scripts/ParagraphStyle_GetSet_xHeight.jsx: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // XHeight_ParagraphStyle.jsx 4 | // A InDesign javascript to get and set the xHeight from seleced paragraph style 5 | // 6 | // Bruno Herfst 2015 7 | // 8 | ////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #target InDesign; 11 | 12 | //Make certain that user interaction (display of dialogs, etc.) is turned on. 13 | app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; 14 | 15 | if (app.documents.length != 0){ 16 | // Global variables 17 | var myDoc = app.activeDocument, myFont = undefined; 18 | 19 | if (app.selection.length == 1){ 20 | switch (app.selection[0].constructor.name){ 21 | //add case for insertion point 22 | case "Text": 23 | case "Paragraph": 24 | case "Character": 25 | case "Word": 26 | showXheightPallette(app.selection[0].appliedParagraphStyle); 27 | break; 28 | default: 29 | alert("This is " + app.selection[0].constructor.name + "\n Please select some text."); 30 | break; 31 | } 32 | } else { 33 | alert("Select some text and try again."); 34 | } 35 | } else { 36 | alert("No documents are open. Please open a document, select some text, and try again."); 37 | } 38 | 39 | function getXHeight(ParagraphStyle, xPercent){ 40 | if (typeof xPercent === 'undefined') { 41 | var xPercent = getXPercent(ParagraphStyle); 42 | } 43 | var fontSize = ParagraphStyle.pointSize; 44 | var xHeight = fontSize/xPercent; 45 | return(xHeight); 46 | } 47 | 48 | function getFontSize(ParagraphStyle, xHeight, xPercent){ 49 | if (typeof xPercent === 'undefined') { 50 | var xPercent = getXPercent(ParagraphStyle); 51 | } 52 | var fontSize = xHeight*xPercent; 53 | return fontSize; 54 | } 55 | 56 | function getXPercent(ParagraphStyle){ 57 | var baseSize = 100; 58 | 59 | tempDoc = app.documents.add(false); 60 | //Set up the new cover. 61 | with(tempDoc.documentPreferences){ 62 | horizontalMeasurementUnits = MeasurementUnits.POINTS; 63 | verticalMeasurementUnits = MeasurementUnits.POINTS; 64 | //Set page size 65 | pageHeight = "2000pt"; 66 | pageWidth = "2000pt"; 67 | pagesPerDocument = 1; 68 | } 69 | with(tempDoc.viewPreferences){ 70 | horizontalMeasurementUnits = MeasurementUnits.POINTS; 71 | verticalMeasurementUnits = MeasurementUnits.POINTS; 72 | rulerOrigin = RulerOrigin.pageOrigin; 73 | } 74 | 75 | var PAGE = tempDoc.pages[0]; 76 | 77 | var myTextFrame = PAGE.textFrames.add(); 78 | myTextFrame.label = "0987654334567890"; 79 | myTextFrame.geometricBounds = PAGE.bounds; 80 | myTextFrame.contents = "x"; 81 | myTextFrame.textFramePreferences.verticalJustification = VerticalJustification.TOP_ALIGN; 82 | myTextFrame.textFramePreferences.insetSpacing = 0; 83 | myTextFrame.textFramePreferences.firstBaselineOffset = FirstBaseline.X_HEIGHT; 84 | 85 | var myStory = myTextFrame.parentStory; 86 | myStory.appliedFont = ParagraphStyle.appliedFont; 87 | myStory.pointSize = baseSize; 88 | 89 | myTextFrame.fit(FitOptions.FRAME_TO_CONTENT); 90 | 91 | var tfBounds = myTextFrame.geometricBounds; // [y1, x1, y2, x2] 92 | var baseXHeight = tfBounds[2] - tfBounds[0]; 93 | 94 | if(tempDoc.isValid){ 95 | tempDoc.close( SaveOptions.NO ); 96 | } 97 | 98 | var xPercent = baseSize/baseXHeight; 99 | 100 | return(xPercent); 101 | } 102 | 103 | function showXheightPallette(ParagraphStyle){ 104 | var xPercent = getXPercent(ParagraphStyle); 105 | var currXheight = getXHeight(ParagraphStyle, xPercent); 106 | 107 | var myDialog = app.dialogs.add({name:"Set X Height", canCancel:true}); 108 | 109 | with(myDialog){ 110 | with(dialogColumns.add()){ 111 | with(dialogRows.add()){ 112 | var xHeightField = measurementComboboxes.add({editUnits:MeasurementUnits.POINTS, editContents:String(currXheight),smallNudge:0.01,largeNudge:1,minWidth:100}); 113 | } 114 | } 115 | } 116 | 117 | if(myDialog.show() == true){ 118 | var xHeight=parseFloat(xHeightField.editValue); 119 | if(xHeight != currXheight){ 120 | var newFontSize = getFontSize(ParagraphStyle, xHeight, xPercent); 121 | ParagraphStyle.pointSize = newFontSize; 122 | } 123 | } else { 124 | myDialog.destroy(); 125 | exit(); 126 | } 127 | } 128 | 129 | -------------------------------------------------------------------------------- /Scripts/ParagraphStyle_Orphan_Fixer.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | Orphan_Fixer.jsx 3 | An InDesign javascript fix orphans on selected paragraph style 4 | Bruno Herfst 2011 5 | */ 6 | 7 | #target indesign; 8 | 9 | 10 | try { 11 | var myDoc = app.activeDocument; 12 | var list_of_All_paragraph_styles = myDoc.paragraphStyles.everyItem().name; 13 | var myCheckboxes = new Array(); 14 | 15 | // create Dialog 16 | var myDialog = app.dialogs.add({name:"ORPHAN FIXER"}); 17 | with(myDialog.dialogColumns.add()){ 18 | staticTexts.add({staticLabel:"Add orphan fixer to paragraphstyle:"}); 19 | with(dialogRows.add()){ 20 | with(borderPanels.add()){ 21 | staticTexts.add({staticLabel:"Trashhold:"}); 22 | var myTHField = textEditboxes.add({editContents:"5"}); 23 | staticTexts.add({staticLabel:"characters"}); 24 | 25 | } 26 | } 27 | } 28 | with(myDialog.dialogColumns.add()){ 29 | for(myCounter=2; myCounter","","","",""); 44 | var replaceChars = new Array("","","","","","~{","~}","~[","~]","~]"); 45 | app.findChangeGrepOptions.includeFootnotes = true; 46 | app.findChangeGrepOptions.includeHiddenLayers = true; 47 | app.findChangeGrepOptions.includeLockedLayersForFind = true; 48 | app.findChangeGrepOptions.includeLockedStoriesForFind = true; 49 | app.findChangeGrepOptions.includeMasterPages = true; 50 | 51 | app.findGrepPreferences = NothingEnum.nothing; 52 | app.changeGrepPreferences = NothingEnum.nothing; 53 | 54 | for(var i=0; i < findChars.length; i++){ 55 | var findChar = findChars[i]; 56 | var replaceChar = replaceChars[i]; 57 | app.findGrepPreferences.findWhat = findChar; 58 | app.changeGrepPreferences.changeTo = replaceChar; 59 | myDoc.changeGrep(); 60 | } 61 | } -------------------------------------------------------------------------------- /Scripts/Quotes_Toggle.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | Quote.jsx 3 | 4 | An InDesign CS6 Javascript 5 | Bruno Herfst 2016 6 | 7 | 8 | Toggle quote marks (Make sure InDesign smart quotes is turned on!) 9 | 10 | EXAMPLE OUTPUT: 11 | ------------------------------------------------------- 12 | selection | replacement 13 | ------------------------------------------------------- 14 | Any string | 'Any string' 15 | 'Any string' | "Any string" 16 | "Any string" | Any string 17 | ------------------------------------------------------- 18 | 19 | HINT: Control-Q is unassigned as a shortcut in InDesign 20 | 21 | */ 22 | 23 | #target InDesign; 24 | 25 | try { 26 | if(app.documents.length != 0){ 27 | //global vars 28 | var myDoc = app.activeDocument; 29 | main(); 30 | }else{ 31 | alert("Please open a document and try again."); 32 | } 33 | } catch(error) { 34 | alert(error.description); 35 | exit(); 36 | } 37 | 38 | 39 | //////////////////////// F U N C T I O N S /////////////////////////////////////////////// 40 | 41 | function main(){ 42 | if(app.selection.length != 0){ 43 | mS = myDoc.selection[0]; 44 | if(mS.constructor.name == "Text" || mS.constructor.name == "Word" || mS.constructor.name == "TextStyleRange"){ 45 | //Check first and last character in string 46 | var str = mS.contents; 47 | mS.contents = toggleQuotes(str); 48 | app.select(mS.characters[0],SelectionOptions.ADD_TO); 49 | }else{ 50 | alert(app.activeDocument.selection[0].constructor.name+"\nPlease select some text"); 51 | exit(); 52 | } 53 | }else{ 54 | alert("Nothing selected\nPlease select some text"); 55 | } 56 | } 57 | 58 | function toggleQuotes(str){ 59 | var firstChar = undefined; 60 | var lastChar = undefined; 61 | 62 | // This also works with text supplied by idiot authors // 63 | 64 | switch(str.charCodeAt(0)){ 65 | case 8216: 66 | case 8217: 67 | case 8218: 68 | case 8219: 69 | case 8242: 70 | case 8245: 71 | firstChar = 1; 72 | break; 73 | case 8220: 74 | case 8221: 75 | case 8222: 76 | case 8223: 77 | case 8243: 78 | case 8246: 79 | firstChar = 2; 80 | break; 81 | default: 82 | firstChar = 0; 83 | break; 84 | } 85 | switch(str.charCodeAt(str.length-1)){ 86 | case 8216: 87 | case 8217: 88 | case 8218: 89 | case 8219: 90 | case 8242: 91 | case 8245: 92 | lastChar = 1; 93 | break; 94 | case 8220: 95 | case 8221: 96 | case 8222: 97 | case 8223: 98 | case 8243: 99 | case 8246: 100 | lastChar = 2; 101 | break; 102 | default: 103 | lastChar = 0; 104 | break; 105 | } 106 | 107 | if(firstChar == lastChar) { 108 | switch(firstChar) { 109 | case 1: 110 | // Single quotes to double 111 | return '"' + str.substr(1, str.length-2) + '"'; 112 | break; 113 | case 2: 114 | // Double quotes nothing 115 | return str.substr(1, str.length-2); 116 | break; 117 | default: 118 | // Do nothing 119 | break; 120 | } 121 | } 122 | // No quotes to single quotes 123 | return("'" + str + "'"); 124 | } -------------------------------------------------------------------------------- /Scripts/Random_Number_Insert.jsx: -------------------------------------------------------------------------------- 1 | #target InDesign; 2 | 3 | //Let’s get the text for the two dices 4 | app.selection[0].contents = String(Math.floor(Math.random()*6)+1) + String(Math.floor(Math.random()*6)+1); -------------------------------------------------------------------------------- /Scripts/Random_Rotate_Between_Values.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Rotate_Between_Values.jsx 4 | Version 1.0 5 | Bruno Herfst 2015 6 | 7 | This script rotates the selected objects somewhere between two given values. 8 | 9 | Please note that this script assumes you have set your preferred reference point 10 | */ 11 | 12 | #target InDesign 13 | 14 | //Make certain that user interaction (display of dialogs, etc.) is turned on. 15 | app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; 16 | 17 | //Check if we have what we need to run the script. 18 | if (app.documents.length == 0){ 19 | alert("Open a document before running this script."); 20 | exit(); 21 | } else if (app.selection.length == 0){ 22 | alert("Select an object before running this script"); 23 | exit(); 24 | } 25 | 26 | var myPathList = new Array; 27 | var myPrefs = {min:0,max:0,reset:'true'}; 28 | 29 | for(var i = 0;i < app.selection.length; i++){ 30 | switch (app.selection[i].constructor.name){ 31 | case "Rectangle": 32 | case "TextFrame": 33 | case "Oval": 34 | case "Polygon": 35 | case "GraphicLine": 36 | case "Group": 37 | case "PageItem": 38 | myPathList.push(app.selection[i]); 39 | break; 40 | } 41 | } 42 | if (myPathList.length == 0){ 43 | alert ("Select a rectangle or text frame and try again."); 44 | exit; 45 | } 46 | 47 | showSettingsUI(); 48 | 49 | function showSettingsUI(){ 50 | // Look for and read prefs file 51 | prefsFile = File((Folder(app.activeScript)).parent + "/Rotate_Bewteen_Values_Memory.txt"); 52 | if(!prefsFile.exists) { 53 | savePrefs(); 54 | } else { 55 | readPrefs(); 56 | } 57 | // Make the dialog box 58 | var dlg = app.dialogs.add({name:"Rotate between"}); 59 | with(dlg.dialogColumns.add()){ 60 | var resetRotation = checkboxControls.add({ staticLabel : 'Reset rotation', checkedState : true }); 61 | staticTexts.add({staticLabel:"Min rotation: "}); 62 | var minRotationInput = angleComboboxes.add({editValue:myPrefs.min}); 63 | staticTexts.add({staticLabel:"Max rotation: "}); 64 | var maxRotationInput = angleComboboxes.add({editValue:myPrefs.max}); 65 | } 66 | 67 | //show dialog 68 | if(dlg.show() == true){ 69 | // Get actual values 70 | myPrefs.min = minRotationInput.editValue % 360; 71 | myPrefs.max = maxRotationInput.editValue % 360; 72 | // Make sure min is smaller then max, for the jokers. 73 | if (myPrefs.min > myPrefs.max) { 74 | var swap=myPrefs.min; myPrefs.min=myPrefs.max; myPrefs.max=swap; 75 | } 76 | myPrefs.reset = resetRotation.checkedState; 77 | savePrefs(); 78 | rotatePaths(); 79 | } 80 | } 81 | 82 | function rotatePaths(){ 83 | for(var objCount = 0;objCount < myPathList.length; objCount++){ 84 | var rotationAngle = myPathList[objCount].absoluteRotationAngle; 85 | if(myPrefs.reset){ 86 | rotationAngle = 0; 87 | } 88 | rotationAngle += randomInRange(myPrefs.min,myPrefs.max); 89 | myPathList[objCount].absoluteRotationAngle = rotationAngle; 90 | } 91 | } 92 | 93 | function randomInRange(start,end){ 94 | return Math.random() * (end - start) + start; 95 | } 96 | 97 | // function to read prefs from a file 98 | function readPrefs() { 99 | try { 100 | prefsFile.open("r"); 101 | myPrefs = eval(prefsFile.readln()); 102 | prefsFile.close(); 103 | } catch(e) { 104 | throwError("Could not read preferences: " + e, false, 2, prefsFile); 105 | } 106 | } 107 | 108 | // function to save prefs to a file 109 | function savePrefs() { 110 | try { 111 | prefsFile.open("w"); 112 | prefsFile.write(myPrefs.toSource()); 113 | prefsFile.close(); 114 | }catch(e){ 115 | throwError("Could not save preferences: " + e, false, 2, prefsFile); 116 | } 117 | } -------------------------------------------------------------------------------- /Scripts/Remove_Doc_Effects.jsx: -------------------------------------------------------------------------------- 1 | 2 | // As described here: https://forums.adobe.com/thread/602984 3 | 4 | var action_Clear_Effects = app.menuActions.itemByID(67880) 5 | var action_Clear_Transparency = app.menuActions.itemByID(67897) 6 | 7 | function clear(doc, clearEffects, clearTransparency){ 8 | if(clearTransparency || clearEffects){ 9 | for(var i=0; i y) { 14 | var ex=x, x=y, y=ex; 15 | } 16 | for(var i = 0; i < links.length; i++) { 17 | var link = links[i].parent; 18 | if( link.fillTint >= x && link.fillTint <= y ) { 19 | link.fillTint = z; 20 | c++; 21 | } 22 | } 23 | return c; 24 | } 25 | 26 | function main(){ 27 | var dlg = app.dialogs.add({name:"Replace Link Tints"}); 28 | 29 | with(dlg.dialogColumns.add()){ 30 | with(dialogRows.add()){ 31 | staticTexts.add({staticLabel:"Find links with tint value bewteen:"}); 32 | } 33 | with(dialogRows.add()){ 34 | with(borderPanels.add()){ 35 | staticTexts.add({staticLabel:"Min:"}); 36 | var xField = percentEditboxes.add({minimumValue:0, maximumValue:100}); 37 | staticTexts.add({staticLabel:"Max:"}); 38 | var yField = percentEditboxes.add({minimumValue:0, maximumValue:100}); 39 | } 40 | } 41 | with(dialogRows.add()){ 42 | staticTexts.add({staticLabel:"Replace with:"}); 43 | } 44 | with(dialogRows.add()){ 45 | with(borderPanels.add()) { 46 | staticTexts.add({staticLabel:"Tint:"}); 47 | var zField = percentEditboxes.add({minimumValue:0, maximumValue:100}); 48 | } 49 | } 50 | } 51 | 52 | //show dialog 53 | if(dlg.show() == true){ 54 | return replaceLinkTints(app.activeDocument, xField.editValue, yField.editValue, zField.editValue ); 55 | } 56 | 57 | return -1; 58 | } 59 | 60 | if (app.documents.length == 0){ 61 | alert("Open a document before running this script."); 62 | } else { 63 | var n = main(); 64 | if(n >= 0) { 65 | alert("Updated " + n + " links."); 66 | } 67 | } -------------------------------------------------------------------------------- /Scripts/Replace_Master.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | ReplaceMaster.jsx 3 | Bruno Herfst 2010 4 | 5 | An InDesign script to find/replace selected Master Pages 6 | */ 7 | 8 | #target indesign; 9 | 10 | var the_document = app.documents.item(0); 11 | 12 | // Create a list of master pages 13 | var list_of_master_pages = the_document.masterSpreads.everyItem().name; 14 | 15 | // Make the dialog box for selecting the paragraph styles 16 | var the_dialog = app.dialogs.add({name:"Replace master pages"}); 17 | with(the_dialog.dialogColumns.add()){ 18 | with(dialogRows.add()){ 19 | staticTexts.add({staticLabel:"Find masterpage:"}); 20 | var find_master = dropdowns.add({stringList:list_of_master_pages, selectedIndex:0}); 21 | } 22 | with(dialogRows.add()){ 23 | staticTexts.add({staticLabel:"Replace master with:"}); 24 | var change_master = dropdowns.add({stringList:list_of_master_pages, selectedIndex:0}); 25 | } 26 | } 27 | 28 | var myResult = the_dialog.show(); 29 | 30 | if(myResult == true){ 31 | // Define masters 32 | var find_master = the_document.masterSpreads.item(find_master.selectedIndex); 33 | var change_master = the_document.masterSpreads.item(change_master.selectedIndex); 34 | 35 | var change_page = []; 36 | 37 | // Find the pages 38 | for(myCounter = 0; myCounter < the_document.pages.length; myCounter++){ 39 | myPage = the_document.pages.item(myCounter); 40 | if (myPage.appliedMaster == find_master){ 41 | change_page.push(myPage); 42 | } 43 | } 44 | 45 | // Apply masters 46 | myCounter = 0; 47 | do { 48 | change_page[myCounter].appliedMaster = change_master; 49 | myCounter++; 50 | } while (myCounter < change_page.length); 51 | 52 | alert("Replaced " + change_page.length + " masters!"); 53 | } else { 54 | exit(); 55 | } 56 | -------------------------------------------------------------------------------- /Scripts/Rotate_Bewteen_Values_Memory.txt: -------------------------------------------------------------------------------- 1 | ({min:2, max:2, reset:true}) -------------------------------------------------------------------------------- /Scripts/Section_2_Master.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Section_2_Master.jsx 4 | Bruno Herfst 2010 5 | 6 | An InDesign script to create a section with marker to selected masterpages (applied) 7 | It can also remove the same section elsewhere. 8 | 9 | */ 10 | 11 | #target indesign; 12 | 13 | var myDoc = app.documents.item(0); 14 | 15 | // Create a list of master pages 16 | var list_of_master_pages = myDoc.masterSpreads.everyItem().name; 17 | 18 | // Dialog 19 | var myDialog = app.dialogs.add({name:"Add section to pages"}); 20 | with(myDialog.dialogColumns.add()){ 21 | with(dialogRows.add()){ 22 | staticTexts.add({staticLabel:"Applied master:"}); 23 | var CM = dropdowns.add({stringList:list_of_master_pages, selectedIndex:0}); 24 | } 25 | with(dialogRows.add()){ 26 | // A decorative checkbox :) 27 | var mySMCheckbox = checkboxControls.add({staticLabel:"Section marker:", checkedState:true}); 28 | var mySMField = textEditboxes.add(); 29 | } 30 | with(dialogRows.add()){ 31 | var myRSMCheckbox = checkboxControls.add({staticLabel:"Remove sectionmarker elsewhere", checkedState:true}); 32 | } 33 | } 34 | 35 | var myResult = myDialog.show(); 36 | 37 | if(myResult == true){ 38 | // Define variables 39 | var find_master = myDoc.masterSpreads.item(CM.selectedIndex); 40 | var mySM = mySMField.editContents; 41 | var myRSM = myRSMCheckbox.checkedState; 42 | 43 | var change_page = []; 44 | 45 | // Find the pages 46 | for(myCounter = 0; myCounter < myDoc.pages.length; myCounter++){ 47 | myPage = myDoc.pages.item(myCounter); 48 | if(myPage.appliedSection.marker == mySM && myPage == myPage.appliedSection.pageStart && myPage.appliedSection.index != 0) { 49 | myPage.appliedSection.remove(); 50 | } 51 | if (myPage.appliedMaster == find_master){ 52 | change_page.push(myPage); 53 | } 54 | } 55 | 56 | // Now we can start sections 57 | myCounter = 0; 58 | do { 59 | 60 | if (change_page[myCounter] == change_page[myCounter].appliedSection.pageStart) { 61 | change_page[myCounter].appliedSection.marker = mySM; 62 | } else { 63 | myDoc.sections.add(change_page[myCounter],{marker:mySM,continueNumbering:true}) 64 | } 65 | 66 | myCounter++; 67 | 68 | } while (myCounter < change_page.length); 69 | 70 | 71 | 72 | alert("Added "+(myCounter+1)+" sections"); 73 | 74 | } else { 75 | exit(); 76 | } -------------------------------------------------------------------------------- /Scripts/Selection_2_Photoshop.jsx: -------------------------------------------------------------------------------- 1 | /*//////////////////////////////////////////////////////////////// 2 | 3 | Selection_2_Clipboard.jsx 4 | Version 1 5 | Tested in InDesign CC 6 | 7 | This script saves slection to be placed in Photoshop. 8 | It adds a new rectangle frame covering the current spread including bleed 9 | so it is easy to paste in place in Photoshop. 10 | 11 | Note: This does not work when selection is bigger then page bleed! 12 | 13 | Bruno Herfst 2016 14 | 15 | ////////////////////////////////////////////////////////////////*/ 16 | 17 | #target indesign; 18 | 19 | try{ 20 | var myDoc = app.activeDocument; 21 | var SPREAD = app.activeWindow.activeSpread; 22 | var SELECTION = []; 23 | if(app.selection.length != 0){ 24 | for(var i=0; i= 0; i--) { 23 | var tf = DocPageOrSpread.textFrames[i]; 24 | if( tf.extractLabel( labelKey ) === labelValue) { 25 | tf.remove(); 26 | }; 27 | }; 28 | }; 29 | 30 | function placeSpreadNumber( num, Spread, offset ) { 31 | // Place the number in the slug 32 | // of first page in spread 33 | var targetPage = Spread.pages[0]; 34 | var tf = targetPage.textFrames.add(); 35 | tf.insertLabel(keyValue, keyValue); 36 | tf.contents = String(num); 37 | tf.paragraphs.everyItem().pointSize = Settings.pointSize; 38 | tf.textFramePreferences.autoSizingType = AutoSizingTypeEnum.HEIGHT_AND_WIDTH; 39 | 40 | // Move item into slug 41 | 42 | // Bounds: y1, x1, y2, x2 43 | var pageBounds = targetPage.bounds; 44 | var itemBounds = tf.geometricBounds; 45 | var itemWidth = itemBounds[3] - itemBounds[1]; 46 | var itemHeight = itemBounds[2] - itemBounds[0]; 47 | 48 | var newBounds = [ pageBounds[0] + Settings.offset.y, 49 | pageBounds[1] + Settings.offset.x, 50 | pageBounds[0] + Settings.offset.y, 51 | pageBounds[1] + Settings.offset.x]; 52 | 53 | newBounds[0] += itemHeight; 54 | newBounds[1] -= itemWidth; 55 | tf.geometricBounds = newBounds; 56 | }; 57 | 58 | function main(){ 59 | var Doc = app.activeDocument; 60 | // Remove any existing numbers 61 | Settings.offset.x -= Doc.documentPreferences.documentBleedOutsideOrRightOffset; 62 | removeLabeledItems( Doc, keyValue, keyValue ); 63 | var count = Doc.spreads.length; 64 | var counter = Settings.startIndex; 65 | for( var i = 0; i < count; i++ ) { 66 | placeSpreadNumber( counter+i, Doc.spreads[i] ); 67 | }; 68 | }; 69 | 70 | main(); 71 | -------------------------------------------------------------------------------- /Scripts/Spirograph.jsx: -------------------------------------------------------------------------------- 1 | //DESCRIPTION:Draw Spirograph 2 | // Jongware, 27-Jun-2010 3 | 4 | myDialog = app.dialogs.add ({name:"Spirograph Swirlies",canCancel:true}); 5 | 6 | with (myDialog) 7 | { 8 | with (dialogColumns.add()) 9 | { 10 | with (dialogRows.add()) 11 | { 12 | with (dialogColumns.add()) 13 | { 14 | with (borderPanels.add()) 15 | { 16 | with (dialogColumns.add()) 17 | { 18 | with (dialogRows.add()) 19 | staticTexts.add ({staticLabel:"Outer radius"}); 20 | with (dialogRows.add()) 21 | aBox = textEditboxes.add({editContents:"80"}); 22 | } 23 | with (dialogColumns.add()) 24 | { 25 | with (dialogRows.add()) 26 | staticTexts.add ({staticLabel:"Outer radius 2"}); 27 | with (dialogRows.add()) 28 | a2Box = textEditboxes.add({editContents:""}); 29 | } 30 | } 31 | with (borderPanels.add()) 32 | { 33 | with (dialogColumns.add()) 34 | { 35 | with (dialogRows.add()) 36 | staticTexts.add ({staticLabel:"Inner radius"}); 37 | with (dialogRows.add()) 38 | bBox = textEditboxes.add({editContents:"13"}); 39 | } 40 | } 41 | with (dialogRows.add()) 42 | staticTexts.add ({staticLabel:"Thickness"}); 43 | with (dialogRows.add()) 44 | hBox = textEditboxes.add({editContents:"20"}); 45 | with (dialogRows.add()) 46 | staticTexts.add ({staticLabel:"Repeats"}); 47 | with (dialogRows.add()) 48 | rBox = textEditboxes.add({editContents:"5"}); 49 | if (app.documents.length > 0) 50 | { 51 | with (dialogRows.add()) 52 | dBox = checkboxControls.add({staticLabel:"New document", checkedState:true}); 53 | } 54 | } 55 | } 56 | } 57 | } 58 | if (!myDialog.show()) 59 | { 60 | myDialog.destroy(); 61 | exit(0); 62 | } 63 | 64 | a = Number(aBox.editContents); 65 | if (a2Box.editContents.length) 66 | a2 = Number(a2Box.editContents); 67 | else 68 | a2 = a; 69 | b = Number(bBox.editContents); 70 | h = Number(hBox.editContents); 71 | reps = Number(rBox.editContents); 72 | if (reps < 1) reps = 1; 73 | 74 | if (app.documents.length == 0) 75 | newdoc = true; 76 | else 77 | newdoc = dBox.checkedState; 78 | 79 | hmeasure = app.viewPreferences.horizontalMeasurementUnits; 80 | vmeasure = app.viewPreferences.verticalMeasurementUnits; 81 | 82 | if (newdoc) 83 | doc = app.documents.add(); 84 | else 85 | doc = app.activeDocument; 86 | 87 | doc.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.MILLIMETERS; 88 | doc.viewPreferences.verticalMeasurementUnits = MeasurementUnits.MILLIMETERS; 89 | 90 | if (newdoc) 91 | { 92 | doc.documentPreferences.pageWidth = 2*Math.abs(a2)-2*Math.abs(b)+2*Math.abs(h)+20; 93 | doc.documentPreferences.pageHeight = 2*Math.abs(a)-2*Math.abs(b)+2*Math.abs(h)+20; 94 | doc.pages[0].marginPreferences.left = 10; 95 | doc.pages[0].marginPreferences.right = 10; 96 | doc.pages[0].marginPreferences.top = 10; 97 | doc.pages[0].marginPreferences.bottom = 10; 98 | } 99 | 100 | doc.zeroPoint = [ app.activeDocument.documentPreferences.pageWidth/2, app.activeDocument.documentPreferences.pageHeight/2 ]; 101 | 102 | aa = Math.max(a,a2); 103 | bb = b; 104 | while (Math.round(aa) != aa || Math.round(bb) != bb) 105 | { 106 | aa *= 10; 107 | bb *= 10; 108 | } 109 | 110 | nLoop = bb/greatestCommonFactor(aa,bb); 111 | dif = 360*nLoop/reps; 112 | 113 | color = 4; 114 | if (color >= app.activeDocument.swatches.length) 115 | color = 2; 116 | 117 | for (l=0; l 10000) 129 | { 130 | if (p == null) 131 | { 132 | p = doc.graphicLines.add().paths[0]; 133 | p.parent.strokeWeight = 0.1; 134 | p.parent.strokeColor = app.activeDocument.swatches[color]; 135 | } else 136 | p = p.parent.paths.add(); 137 | p.entirePath = path; 138 | path = [ [x,y] ]; 139 | } 140 | } 141 | 142 | if (path.length > 1) 143 | { 144 | if (p == null) 145 | { 146 | p = doc.graphicLines.add().paths[0]; 147 | p.parent.strokeWeight = 0.1; 148 | p.parent.strokeColor = app.activeDocument.swatches[color]; 149 | } else 150 | p = p.parent.paths.add(); 151 | p.entirePath = path; 152 | } 153 | color++; 154 | if (color == 3) color++; 155 | if (color >= app.activeDocument.swatches.length) 156 | color = 2; 157 | } 158 | 159 | function greatestCommonFactor (x,y) 160 | { 161 | while (y != 0) 162 | { 163 | w = x % y; 164 | x = y; 165 | y = w; 166 | } 167 | return x; 168 | } 169 | 170 | doc.viewPreferences.horizontalMeasurementUnits = hmeasure; 171 | doc.viewPreferences.verticalMeasurementUnits = vmeasure; -------------------------------------------------------------------------------- /Scripts/Story_2_Margin.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Story_2_Margin.jsx 4 | Indesign CS5 javascript 5 | Bruno Herfst 2013 6 | 7 | Finds stories and resizes and aligns all textframes to pagemargin. 8 | (except for locked layers) 9 | 10 | */ 11 | 12 | #target indesign 13 | main(); 14 | 15 | function main(){ 16 | //Make certain that user interaction (display of dialogs, etc.) is turned on. 17 | app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; 18 | if(app.documents.length != 0){ 19 | myDoc = app.activeDocument; 20 | if(app.selection.length != 0){ 21 | var mySelection = app.selection[0]; 22 | var myStory = undefined; 23 | switch(mySelection.constructor.name){ 24 | //we can add insertion points paragraphs too just look them up 25 | case "TextFrame": 26 | case "Paragraph": 27 | case "Text": 28 | case "Line": 29 | case "Word": 30 | case "Character": 31 | myStory = mySelection.parentStory 32 | break; 33 | default: 34 | var ws = mySelection.constructor.name; 35 | alert("This is a "+ws+" \rPlease select a TextFrame and try again."); 36 | exit(); 37 | } 38 | alignStory(myStory); 39 | }else{ 40 | alert("Please select a TextFrame and try again."); 41 | } 42 | }else{ 43 | alert("Please open a document and try again."); 44 | } 45 | } 46 | 47 | function alignStory(myStory){ 48 | for(var myCounter = myStory.textContainers.length-1; myCounter >= 0; myCounter --){ 49 | var myTextFrame = myStory.textContainers[myCounter]; 50 | switch(myTextFrame.constructor.name){ 51 | case "TextFrame": 52 | //I use a try statement here so it will continue moving text 53 | //even if it finds text on a locked layer. 54 | try{ 55 | fit(myTextFrame); 56 | } 57 | catch (myError){} 58 | break; 59 | default: 60 | try{ 61 | fit(myTextFrame); 62 | } 63 | catch (myError){} 64 | } 65 | } 66 | } 67 | 68 | function fit(myRect){ 69 | var myPage = myRect.parentPage; 70 | var marginBounds = getMarginBounds(myPage); 71 | myRect.geometricBounds = marginBounds; 72 | } 73 | 74 | function getMarginBounds(thisPage){ 75 | pH = doRound(thisPage.bounds[2]-thisPage.bounds[0], 3); 76 | pW = doRound(thisPage.bounds[3]-thisPage.bounds[1], 3); 77 | if(thisPage.side == PageSideOptions.LEFT_HAND){ 78 | return [thisPage.marginPreferences.top, pW-thisPage.marginPreferences.left, pH-thisPage.marginPreferences.bottom, thisPage.marginPreferences.right]; 79 | } else { // PageSideOptions.SINGLE_SIDED or PageSideOptions.RIGHT_HAND 80 | return [thisPage.marginPreferences.top, pW-thisPage.marginPreferences.right, pH-thisPage.marginPreferences.bottom, thisPage.marginPreferences.left]; 81 | } 82 | } 83 | function doRound(myNum, roundDec) { 84 | var roundMulit = Math.pow(10,roundDec); 85 | return Math.round(myNum*roundMulit)/roundMulit; 86 | } 87 | -------------------------------------------------------------------------------- /Scripts/Story_Sort_Paragraph_LastCharX.jsx: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 4 | Story_Sort_Paragraph_LastCharX.jsx 5 | Version 1.0 6 | 7 | Indesign CS5 javascript 8 | Bruno Herfst 2019 9 | 10 | */ 11 | 12 | #target "InDesign" 13 | 14 | 15 | function compareEndX(a, b) { 16 | if (a[1] === b[1]) { 17 | return 0; 18 | } 19 | else { 20 | return (a[1] < b[1]) ? -1 : 1; 21 | } 22 | } 23 | 24 | function bubbleSortLastX( story ) { 25 | if (story.overflows) { 26 | alert("Skipped story " + story.id + ": Contains overflow text." ); 27 | return false; 28 | } 29 | 30 | myParagraphs = story.paragraphs; 31 | 32 | // Make sure we end with a new line char 33 | if(myParagraphs[0].parentStory.insertionPoints[-1].index == myParagraphs[-1].insertionPoints[-1].index){ 34 | myParagraphs[-1].insertionPoints[-1].contents = "\r"; 35 | myCleanUp = true; 36 | } else { 37 | myCleanUp = false; 38 | } 39 | 40 | do{ 41 | myItemMoved = false; 42 | myCounter = 0; 43 | do{ 44 | locA = myParagraphs.item(myCounter).characters.item(-1).horizontalOffset; 45 | locB = myParagraphs.item(myCounter+1).characters.item(-1).horizontalOffset; 46 | if(locA > locB){ 47 | myParagraphs.item(myCounter).move(LocationOptions.after, myParagraphs.item(myCounter+1)); 48 | myItemMoved = true; 49 | } 50 | myCounter ++; 51 | }while (myCounter < myParagraphs.length-1); 52 | myCounter = myParagraphs.length-1; 53 | do{ 54 | locA = myParagraphs.item(myCounter).characters.item(-1).horizontalOffset; 55 | locB = myParagraphs.item(myCounter-1).characters.item(-1).horizontalOffset; 56 | if(locA < locB){ 57 | myParagraphs.item(myCounter).move(LocationOptions.before, myParagraphs.item(myCounter-1)); 58 | myItemMoved = true; 59 | } 60 | myCounter --; 61 | }while(myCounter > 1); 62 | }while(myItemMoved != false); 63 | 64 | if(myCleanUp == true){ 65 | myParagraphs[0].parentStory.characters[-1].remove(); 66 | } 67 | 68 | return true; 69 | } 70 | 71 | function getStories( doc ) { 72 | var mySelection = doc.selection; 73 | var selected_stories = []; 74 | 75 | if( mySelection.length === 0){ 76 | // Do all stories 77 | for(var i = 0; i < doc.stories.length; i++){ 78 | selected_stories.push(doc.stories.item(i)); 79 | }; 80 | } else { 81 | // Do stories in selection 82 | for(var i = 0; i < mySelection.length; i++){ 83 | switch(mySelection[i].constructor.name){ 84 | case "TextFrame": 85 | case "Paragraph": 86 | case "Text": 87 | case "Line": 88 | case "Word": 89 | case "Character": 90 | case "TextColumn": 91 | case "TextStyleRange": 92 | case "InsertionPoint": 93 | var pStory = mySelection[i].parentStory; 94 | if(notInArray(pStory, selected_stories)){ 95 | selected_stories.push(pStory); 96 | }; 97 | break; 98 | default: 99 | alert("Could not find a solution for " + mySelection[i].constructor.name); 100 | break; 101 | }; 102 | }; 103 | }; 104 | 105 | return selected_stories; 106 | }; 107 | 108 | function notInArray(needle, array) { 109 | for(var i = 0; i < array.length; i++) { 110 | if(array[i] === needle) { 111 | return false; 112 | } 113 | } 114 | return true; 115 | }; 116 | 117 | function main() { 118 | //Make certain that user interaction (display of dialogs, etc.) is turned on. 119 | app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; 120 | if (app.documents.length != 0) { 121 | var doc = app.activeDocument; 122 | var stories = getStories( doc ); 123 | var storyLen = stories.length; 124 | if (storyLen == 0) alert("Could not find any stories active document."); 125 | for(var i = 0; i < storyLen; i++) { 126 | bubbleSortLastX( stories[i] ); 127 | } 128 | } else { 129 | alert("Please open a document and try again."); 130 | } 131 | } 132 | 133 | main(); 134 | -------------------------------------------------------------------------------- /Scripts/Story_Splitter.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Story_Splitter.jsx 4 | 5 | Headless story splitter based on StorySplitter by FourAces 6 | 7 | With selection: Splits all stories found in selection 8 | Without selection: Splits all stories in active document 9 | 10 | ---------------------------------------------------------------------- 11 | StorySplitter 12 | ---------------------------------------------------------------------- 13 | An InDesign CS/CS2/CS3 JavaScript by FourAces 14 | © The Final Touch 2006 15 | Version 3.0 16 | 17 | Splits the selected Story to separate Text Frames, while maintaining their contents. 18 | ---------------------------------------------------------------------- 19 | */ 20 | 21 | #target indesign; 22 | 23 | function mySplitAll( tFrames ) { 24 | var len = tFrames.length; 25 | if (len === 1) return; 26 | for(var i = 0; i < len; i++){ 27 | tFrames[i].duplicate(); 28 | }; 29 | for(var i = 0; i < len; i++){ 30 | tFrames[i].remove(); 31 | }; 32 | }; 33 | 34 | function splitStories( storyArr ) { 35 | for(var i = 0; i < storyArr.length; i++) { 36 | var myStory = storyArr[i]; 37 | if(app.version.split(".")[0] >= 5){ 38 | var tFrames = myStory.textContainers; 39 | } else { 40 | var tFrames = myStory.textFrames; 41 | }; 42 | mySplitAll( tFrames ); 43 | }; 44 | }; 45 | 46 | function notInArray(needle, array) { 47 | for(var i = 0; i < array.length; i++) { 48 | if(array[i] === needle) { 49 | return false; 50 | } 51 | } 52 | return true; 53 | }; 54 | 55 | //--------------------------------------------------------------------- 56 | 57 | if(app.documents.length != 0){ 58 | var mySelection = app.activeDocument.selection; 59 | var selected_stories = []; 60 | if( mySelection.length === 0){ 61 | // Do all stories 62 | for(var i = 0; i < app.activeDocument.stories.length; i++){ 63 | selected_stories.push(app.activeDocument.stories.item(i)); 64 | }; 65 | } else { 66 | // Do stories in selection 67 | for(var i = 0; i < mySelection.length; i++){ 68 | switch(mySelection[i].constructor.name){ 69 | //we can add insertion points paragraphs too just look them up 70 | case "TextFrame": 71 | case "Paragraph": 72 | case "Text": 73 | case "Line": 74 | case "Word": 75 | case "Character": 76 | case "TextColumn": 77 | case "TextStyleRange": 78 | var myStory = mySelection[i].parentStory; 79 | if(notInArray(myStory, selected_stories)){ 80 | selected_stories.push(myStory); 81 | }; 82 | break; 83 | default: 84 | break; 85 | }; 86 | }; 87 | }; 88 | splitStories(selected_stories); 89 | alert("Done"); 90 | } else { 91 | alert("No Active Document Found.\nPlease open an InDesign document and select a Story to split."); 92 | } // EOF 93 | -------------------------------------------------------------------------------- /Scripts/Tables_2_Frame.jsx: -------------------------------------------------------------------------------- 1 | // Size a frame's tables to the width of the frame 2 | // by resizing columns proportionally. 3 | // Peter Kahrel -- www.kahrel.plus.com 4 | 5 | // Adjusted by Bruno Herfst to suit needs: 6 | // 1. Don't check if columns are wide enough 7 | // 2. Set rows to auto grow 8 | 9 | (function () { 10 | 11 | var units; 12 | 13 | //---------------------------------------------- 14 | // Get a table's resizeable columns, then resize them 15 | // Take the right edge into account. Border are a mess, 16 | // we ignore them. 17 | 18 | function resizeTable (table, frameWidth) { 19 | var columns = table.columns.everyItem().getElements(); 20 | var tableWidth = table.width 21 | var excess = Math.abs (frameWidth - tableWidth); 22 | var addon = excess/columns.length; 23 | for (var i = table.columns.length-1; i >= 0; i--) { 24 | table.columns[i].width += addon; 25 | } 26 | } 27 | 28 | // ---------------------------------------------- 29 | // Get the selected frame and resize the tables that aren't the frame's width 30 | // (Fix the height of all rows at 12 points) 31 | 32 | function resizeTables (frame) { 33 | var frameWidth = frame.geometricBounds[3] - frame.geometricBounds[1]; 34 | var tables = frame.tables.everyItem().getElements(); 35 | for (var i = tables.length-1; i >= 0; i--) { 36 | if (tables[i].width !== frameWidth) { 37 | resizeTable (tables[i], frameWidth); 38 | } 39 | tables[i].rows.everyItem().autoGrow = true; 40 | } 41 | } 42 | 43 | 44 | if (app.selection.length > 0 && app.selection[0] instanceof TextFrame) { 45 | units = app.scriptPreferences.measurementUnit; 46 | app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS; 47 | resizeTables (app.selection[0]); 48 | app.scriptPreferences.measurementUnit = units; 49 | } else { 50 | alert ('Please select a text frame.', 'Size tables', true); 51 | } 52 | 53 | }()); 54 | -------------------------------------------------------------------------------- /Scripts/TextFrame-Inline_Remove.js: -------------------------------------------------------------------------------- 1 | // Remove in-line textFrames 2 | // Bruno Herfst 2018 3 | 4 | function removeInlineTextFrame( inFrame ) { 5 | if(inFrame.constructor.name !== "TextFrame" || inFrame.parent.constructor.name !== "Character") { 6 | return false; 7 | }; 8 | inFrame.parentStory.paragraphs.everyItem().duplicate(LocationOptions.BEFORE, inFrame.parent.insertionPoints[0]); 9 | inFrame.remove(); 10 | return true; 11 | }; 12 | 13 | function removeInlineTextFrames( selection ) { 14 | // Does selection contain textFrames 15 | var i = selection.textFrames.length; 16 | if( i != 0 ) { 17 | // Selection contains textFrame 18 | while( i-- ){ // Recurse 19 | removeInlineTextFrames( selection.textFrames[i] ); 20 | }; 21 | }; 22 | // Check if selection itself is a textFrame 23 | if(selection.constructor.name === "TextFrame") { 24 | removeInlineTextFrame( selection ); 25 | }; 26 | }; 27 | 28 | function main() { 29 | if (app.selection.length == 1){ 30 | switch (app.selection[0].constructor.name){ 31 | case "Text": 32 | case "TextStyleRange": 33 | case "TextColumn": 34 | case "Paragraph": 35 | app.selection[0].textFrames; 36 | break; 37 | case "TextFrame": 38 | removeInlineTextFrames( app.selection[0] ); 39 | break; 40 | default: 41 | alert("This is a "+ app.selection[0].constructor.name +"\nSelect some text or a textFrame and try again."); 42 | break; 43 | }; 44 | } else { 45 | alert("Please select a single Text or textFrame"); 46 | }; 47 | }; 48 | 49 | if(app.documents.length != 0){ 50 | //global vars 51 | try { 52 | // Run script with single undo if supported 53 | if (parseFloat(app.version) < 6) { 54 | main(); 55 | } else { 56 | app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Expand State Abbreviations"); 57 | }; 58 | // Error reporting 59 | } catch ( error ) { 60 | alert("Oops, something went wrong:\n" + error + " (Line " + error.line + " in file " + error.fileName + ")"); 61 | }; 62 | }else{ 63 | alert("Please open a document and try again."); 64 | }; -------------------------------------------------------------------------------- /Scripts/Text_2_Layer.jsx: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | 4 | Text_2_Layer.jsx 5 | Version 2.0 6 | 7 | Indesign CS5 javascript 8 | Bruno Herfst 2011 9 | 10 | Move all text to new layer (except for locked layers) 11 | Finds stories and moves all it’s textframes to a new layer. 12 | This makes sure all text will be done even TextPaths. 13 | 14 | 12.12.13: Added layer support 15 | 16 | */ 17 | 18 | #target "InDesign" 19 | var myDoc, selectedLayer = undefined; 20 | 21 | function go() { 22 | //Make certain that user interaction (display of dialogs, etc.) is turned on. 23 | app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll; 24 | if (app.documents.length != 0) { 25 | //get ref to doc 26 | myDoc = app.activeDocument; 27 | myDisplayDialog(); 28 | } else { 29 | alert("Please open a document and try again."); 30 | } 31 | } 32 | 33 | //start dialog 34 | function myDisplayDialog() { 35 | // Create lists 36 | var list_of_layers = myDoc.layers.everyItem().name; 37 | list_of_layers.push("[New Layer]"); 38 | 39 | var myDialog = app.dialogs.add({ 40 | name: "Move all text to layer" 41 | }); 42 | 43 | with(myDialog.dialogColumns.add()) { 44 | var mySelectedLayer = dropdowns.add({ 45 | stringList: list_of_layers 46 | }); 47 | mySelectedLayer.selectedIndex = 0; 48 | } 49 | 50 | var myResult = myDialog.show(); 51 | 52 | if (myResult == true) { 53 | if (mySelectedLayer.selectedIndex == list_of_layers.length - 1) { 54 | selectedLayer = createLayer(); 55 | } else { 56 | selectedLayer = myDoc.layers[mySelectedLayer.selectedIndex]; 57 | } 58 | 59 | myDialog.destroy(); 60 | 61 | //do story 62 | if (selectedLayer != undefined) { 63 | doAllStories(); 64 | } 65 | } else { 66 | myDialog.destroy(); 67 | exit(); 68 | } 69 | } 70 | //end dialog 71 | 72 | function doAllStories() { 73 | //send every story to a new layer 74 | for (var i = 0; i < myDoc.stories.length; i++) { 75 | myStory = myDoc.stories.item(i); 76 | moveStoryToLayer(myStory, selectedLayer); 77 | } 78 | alert("All found text to layer " + selectedLayer.name); 79 | } 80 | 81 | function moveStoryToLayer(myStory, selectedLayer) { 82 | var myTextFrame; 83 | for (var myCounter = myStory.textContainers.length - 1; myCounter >= 0; myCounter--) { 84 | myTextFrame = myStory.textContainers[myCounter]; 85 | switch (myTextFrame.constructor.name) { 86 | case "TextFrame": 87 | //I use a try statement here so it will continue moving text 88 | //even if it finds text on a locked layer. 89 | try { 90 | myTextFrame.move(selectedLayer); 91 | } catch (myError) {} 92 | break; 93 | default: 94 | try { 95 | myTextFrame.parent.move(selectedLayer); 96 | } catch (myError) {} 97 | } 98 | } 99 | } 100 | 101 | function createLayer() { 102 | var layerName = prompt("New layer name:"); 103 | if (layerName != null) { 104 | var layer = myDoc.layers.item(layerName); 105 | if (layer.isValid) { 106 | alert("Layer already exist!"); 107 | createLayer(); 108 | } else { 109 | layer = myDoc.layers.add({ 110 | name: layerName 111 | }); 112 | return layer; 113 | } 114 | } else { 115 | return undefined; 116 | } 117 | } 118 | 119 | go(); 120 | 121 | -------------------------------------------------------------------------------- /Scripts/Text_2_breakFrame.jsx: -------------------------------------------------------------------------------- 1 | //DESCRIPTION:CopyCutter -- Run Me On A Text Frame To Shred It Into Strips 2 | // A Jongware script 7-Aug-2011 3 | // w/Thanks to SebastiaoV to find a working version 4 | 5 | // Updated 2018 by Bruno Herfst 6 | // - Use findGrep() instead of changeGrep() 7 | // - Add single undo 8 | // - Move any RegEx 9 | 10 | var regex = "^(.+\n?)+$"; // Paragraphs 11 | var toSide = true; 12 | 13 | // Run script with single undo if supported 14 | if (parseFloat(app.version) < 6) { 15 | main(); 16 | } else { 17 | app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Expand State Abbreviations"); 18 | }; 19 | 20 | function main() { 21 | try { 22 | if (app.selection.length == 1 && app.selection[0].hasOwnProperty("baseline") && app.selection[0].length > 1) { 23 | app.findGrepPreferences = null; 24 | app.changeGrepPreferences = null; 25 | app.findGrepPreferences.findWhat = regex; 26 | var result = app.selection[0].findGrep(); 27 | var i = result.length; 28 | while ( i-- ) { 29 | app.select(result[i]); 30 | var ptf = app.selection[0].parentTextFrames[0]; 31 | var txt = app.selection[0].texts[0]; 32 | var topBL = txt.characters[0].baseline; 33 | var botBL = txt.characters[-1].baseline; 34 | // [ y1 , x1 , y2 , x2 ] 35 | if( toSide ) { 36 | var bnds = [ topBL, ptf.geometricBounds[3], botBL+500, ptf.geometricBounds[3]+(ptf.geometricBounds[3]-ptf.geometricBounds[1]) ]; 37 | } else { 38 | var bnds = [ topBL, ptf.geometricBounds[1], botBL+500, ptf.geometricBounds[3] ]; 39 | } 40 | var f = app.activeDocument.layoutWindows[0].activePage.textFrames.add ({geometricBounds:bnds}); 41 | txt.move (LocationOptions.AFTER, f.texts[0]); 42 | var nbl = f.characters[0].baseline; 43 | var offset = nbl - topBL; 44 | bnds[0] -= offset; 45 | bnds[2] -= 500; 46 | f.geometricBounds = bnds; 47 | } 48 | } else { 49 | alert ("please select some text to shred"); 50 | }; 51 | // Global error reporting 52 | } catch ( error ) { 53 | alert( error + " (Line " + error.line + " in file " + error.fileName + ")"); 54 | }; 55 | }; -------------------------------------------------------------------------------- /Scripts/Text_Change_Case_With_Style.jsx: -------------------------------------------------------------------------------- 1 | /* 2 | Change_Case_With_Style.jsx 3 | Version: 1.5 4 | 5 | Script by Thomas Silkjær 6 | http://indesigning.net/ 7 | 8 | Find style, GREP expression and cancel added by Bruno Herfst 2011 9 | Apply Local formatting removed (Bad practice) 10 | */ 11 | 12 | #target indesign; 13 | 14 | 15 | try { 16 | var the_document = app.documents.item(0); 17 | 18 | // Create a list of character styles 19 | var list_of_character_styles = the_document.characterStyles.everyItem().name; 20 | list_of_character_styles.unshift("Any"); 21 | 22 | // Create a list of paragraph styles 23 | var list_of_paragraph_styles = the_document.paragraphStyles.everyItem().name; 24 | list_of_paragraph_styles.unshift("Nope"); 25 | 26 | 27 | // Make the dialog box for the change case search 28 | var the_dialog = app.dialogs.add({name:"Change case"}); 29 | with(the_dialog.dialogColumns.add()){ 30 | with(dialogRows.add()){ 31 | staticTexts.add({staticLabel:"Search for (GREP):"}); 32 | var grep_string = textEditboxes.add({editContents:"\\<(([\\s'\\u–]){1,}(\\u){2,})|(\\u\\s\\u\\u)\\>",minWidth:200}); 33 | } 34 | with(dialogRows.add()){ 35 | staticTexts.add({staticLabel:"With applied Paragraph style:"}); 36 | var find_paragraph_style = dropdowns.add({stringList:list_of_paragraph_styles, selectedIndex:0}); 37 | } 38 | with(dialogRows.add()){ 39 | staticTexts.add({staticLabel:"Change case to:"}); 40 | var change_case_to_text = dropdowns.add({stringList:["UPPERCASE","lowercase","Title Case","Sentence case"], selectedIndex:0}); 41 | } 42 | with(dialogRows.add()){ 43 | staticTexts.add({staticLabel:"Apply character style?"}); 44 | var apply_cstyle = dropdowns.add({stringList:list_of_character_styles, selectedIndex:0}); 45 | } 46 | with(dialogRows.add()){ 47 | staticTexts.add({staticLabel:"Search:"}); 48 | var search_in = dropdowns.add({stringList:["Story","Document"], selectedIndex:1}); 49 | } 50 | } 51 | } catch(err) { 52 | alert(err.description); 53 | } 54 | 55 | //the_dialog.show(); 56 | if(the_dialog.show() == true){ 57 | go(); 58 | }else{ 59 | the_dialog.destroy(); 60 | exit; 61 | } 62 | 63 | function go(){ 64 | if (find_paragraph_style.selectedIndex == 0) { 65 | var find_paragraph = false; 66 | } else { 67 | var find_paragraph = the_document.paragraphStyles.item(find_paragraph_style.selectedIndex-1); 68 | } 69 | 70 | //Define change_case_to 71 | if(change_case_to_text.selectedIndex == 0) { 72 | change_case_to = ChangecaseMode.UPPERCASE; 73 | } else if(change_case_to_text.selectedIndex == 1) { 74 | change_case_to = ChangecaseMode.LOWERCASE; 75 | } else if(change_case_to_text.selectedIndex == 2) { 76 | change_case_to = ChangecaseMode.TITLECASE; 77 | } else { 78 | change_case_to = ChangecaseMode.SENTENCECASE; 79 | } 80 | 81 | // Set find grep preferences to find text with the grep value entered in the dialog 82 | app.findChangeGrepOptions.includeFootnotes = false; 83 | app.findChangeGrepOptions.includeHiddenLayers = false; 84 | app.findChangeGrepOptions.includeLockedLayersForFind = false; 85 | app.findChangeGrepOptions.includeLockedStoriesForFind = false; 86 | app.findChangeGrepOptions.includeMasterPages = false; 87 | 88 | app.findGrepPreferences = NothingEnum.nothing; 89 | app.findGrepPreferences.findWhat = grep_string.editContents; 90 | if(find_paragraph == false){ 91 | app.findGrepPreferences.appliedParagraphStyle = NothingEnum.nothing; 92 | } else { 93 | app.findGrepPreferences.appliedParagraphStyle = find_paragraph; 94 | } 95 | 96 | // Search 97 | if(search_in.selectedIndex == 0) { 98 | var the_story = app.selection[0].parentStory; 99 | var found_texts = the_story.findGrep(); 100 | } else { 101 | var found_texts = the_document.findGrep(); 102 | } 103 | 104 | // Loop through found text and change the case, apply local formatting and character styles 105 | if(found_texts.length != 0) { 106 | for (i=0;i 5 && app.documents.length > 0) 7 | try {highlight_nobreak (app.documents[0])} 8 | catch (e) {alert (e.message + "\r(line " + e.line + ")")}; 9 | 10 | 11 | function highlight_nobreak (doc) 12 | { 13 | var nobreak = check_condition (doc, "nobreak"); 14 | app.findGrepPreferences = app.changeGrepPreferences = null; 15 | app.findGrepPreferences.noBreak = true; 16 | app.changeGrepPreferences.appliedConditions = [nobreak]; 17 | app.documents[0].changeGrep (); 18 | // Conditional text is visible only in Normal screen mode 19 | app.documents[0].layoutWindows[0].screenMode = ScreenModeOptions.previewOff; 20 | } 21 | 22 | 23 | function check_condition (doc, name_) 24 | { 25 | // Delete condition if it exists 26 | if (doc.conditions.item (name_) != null) 27 | doc.conditions.item (name_).remove (); 28 | doc.conditions.add ({ 29 | name: name_, 30 | indicatorColor: [225,225,255], 31 | indicatorMethod: ConditionIndicatorMethod.useHighlight}); 32 | return doc.conditions.item (name_) 33 | } -------------------------------------------------------------------------------- /Scripts/View_Overrides.jsx: -------------------------------------------------------------------------------- 1 | #target InDesign; 2 | 3 | /***********************************************************************/ 4 | /* */ 5 | /* ShowHideLocalFormatting :: Show/hide local formatting */ 6 | /* */ 7 | /* [Ver: 1.1] [Author: Marc Autret] [Modif: 05/25/10] */ 8 | /* [Lang: EN] [Req: InDesign CS4] [Creat: 05/09/10] */ 9 | /* */ 10 | /* Installation: */ 11 | /* */ 12 | /* 1) Place the current file into Scripts/Scripts Panel/ */ 13 | /* */ 14 | /* 2) Run InDesign, open a document containing texts */ 15 | /* */ 16 | /* 3) Exec script from Window > Automatisation > Scripts */ 17 | /* (double-click on the script name) */ 18 | /* */ 19 | /* Bugs & Feedback : marc{at}indiscripts{dot}com */ 20 | /* www.indiscripts.com */ 21 | /* */ 22 | /***********************************************************************/ 23 | 24 | if( app.documents.length && 25 | app.activeDocument.textPreferences.enableStylePreviewMode^= 1 && 26 | app.layoutWindows.length && 27 | app.activeWindow.constructor==LayoutWindow){ 28 | //app.activeDocument.paragraphStyles.item("Paragraph Style 1").previewColor = UIColors.YELLOW; 29 | app.activeWindow.screenMode = ScreenModeOptions.previewOff; 30 | // UPDATE [100525] - THX to ptruskier 31 | app.activeWindow.overprintPreview = false; 32 | } 33 | -------------------------------------------------------------------------------- /Scripts/kern/kern_Adobe Caslon Pro.txt: -------------------------------------------------------------------------------- 1 | --- Lines starting with three hyphens are ignored, --- can be used for comments 2 | --- Empty lines are ignored, too 3 | 4 | ===Regular 5 | f \u 185 6 | ['"] \u 120 7 | -------------------------------------------------------------------------------- /Scripts/kern/kern_Bembo Std.txt: -------------------------------------------------------------------------------- 1 | --- Lines starting with three hyphens are ignored, --- can be used for comments 2 | --- Empty lines are ignored, too 3 | 4 | ===Regular 5 | f\? 150 6 | T 45 7 | V 30 8 | 9 | === Italic Regular 10 | l\? 50 -------------------------------------------------------------------------------- /Scripts/kern/kern_Blanco.txt: -------------------------------------------------------------------------------- 1 | --- Lines starting with three hyphens are ignored, --- can be used for comments 2 | --- Empty lines are ignored, too 3 | 4 | ===Regular 5 | N[oe] -20 6 | ra -25 7 | 8 | ===Bold 9 | N[oe] -20 10 | ra -25 -------------------------------------------------------------------------------- /Scripts/kern/kern_Dolly.txt: -------------------------------------------------------------------------------- 1 | --- Lines starting with three hyphens are ignored, --- can be used for comments 2 | --- Empty lines are ignored, too 3 | 4 | ===Roman 5 | [er]y 35 6 | er 20 7 | to 5 8 | ll 10 9 | [hnl]e -5 10 | ga -10 11 | [oe][oe] -5 -------------------------------------------------------------------------------- /Scripts/kern/kern_Emona.txt: -------------------------------------------------------------------------------- 1 | --- Lines starting with three hyphens are ignored, --- can be used for comments 2 | --- Empty lines are ignored, too 3 | 4 | ===Regular 5 | ['"][ds] -70 6 | [ywmr]o -10 7 | rn 42 8 | fr 50 9 | fa 10 10 | st 10 11 | dr 20 12 | el -20 13 | y['"] 50 14 | [vh]e -17 15 | er 12 16 | gi 20 17 | ke -40 18 | ['"]s -40 19 | u[nr] 27 20 | nd -22 21 | de -8 22 | el -6 23 | le -10 24 | [oa][yw] -20 25 | xc -25 26 | Wa -20 27 | Wa -50 28 | [od]o -15 29 | to -5 30 | ft 30 31 | ar 5 32 | ta 10 33 | th 20 34 | uc -10 35 | nc -25 36 | ho -30 37 | ty 5 38 | ue -15 39 | [ao]u -5 40 | wa -15 41 | n['"] -50 42 | pp -10 43 | dd -48 44 | ri 40 45 | id -15 46 | dl 5 47 | ts 9 48 | si 7 49 | me -8 50 | wd -5 51 | po 10 52 | vi 25 53 | av -15 54 | as 10 55 | ll -10 56 | nk -10 57 | ne -20 58 | tn 40 59 | rt 25 60 | ou -15 61 | ra 15 62 | br 25 63 | [wl]e -15 64 | 65 | --- Ligatures 66 | (?<=f)l[o] -20 67 | 68 | ===SC 69 | 74 -32 70 | 40 -45 71 | 78 17 72 | 97 -15 -------------------------------------------------------------------------------- /Scripts/kern/kern_IM FELL Great Primer PRO.txt: -------------------------------------------------------------------------------- 1 | --- Lines starting with three hyphens are ignored, --- can be used for comments 2 | --- Empty lines are ignored, too 3 | 4 | ===Regular 5 | g, 85 6 | f\? 135 7 | 8 | ===Regular Italic 9 | ['"]A -210 10 | 11 | ===Italic Regular 12 | t['"] 100 -------------------------------------------------------------------------------- /Scripts/kern/kern_Italian Old Style MT.txt: -------------------------------------------------------------------------------- 1 | --- Lines starting with three hyphens are ignored, --- can be used for comments 2 | --- Empty lines are ignored, too 3 | 4 | ===Roman 5 | '[m] -60 6 | [yw]~< -80 7 | 8 | --- Ligatures 9 | (?<=f)l[o] -35 10 | 11 | ===Roman Italic 12 | '[mt] -60 13 | 14 | ===Italic 15 | '[m] -60 -------------------------------------------------------------------------------- /Scripts/kern/kern_Minion Pro.txt: -------------------------------------------------------------------------------- 1 | --- Lines starting with three hyphens are ignored, --- can be used for comments 2 | --- Empty lines are ignored, too 3 | 4 | ===Regular 5 | uT -160 6 | -\* -160 7 | [VW]- -120 8 | T[-\x{2013}] -135 9 | [-\x{2013}]T -100 10 | ~_~_ -100 11 | /[/.] -100 12 | \*[-\x{2011}] -100 13 | /A -90 14 | [-\x{2013}][VWY] -80 15 | \x{2019}[,.] -80 16 | T/ -80 17 | oW -80 18 | [VW]s -60 19 | [-\x{2013}]A -40 20 | k- -40 21 | /[\l] -40 22 | -J -40 23 | \.\x{2019} -40 24 | -w -20 25 | [ij]\x{2019} 10 26 | :/ 20 27 | \x{2019}[BCDEFHIKLMNPRTU] 50 28 | \w\( 60 29 | \x{2018}/ 60 30 | /\x{2018} 120 31 | 32 | 33 | --- Any pair of quotes, any quote followed by ? 34 | ["']['"?] 50 35 | 36 | --- Apostrophe used as soft sign (transliterated Cyrillic) 37 | \x{2019}[cč] -40 38 | 39 | --- The following are needed for French -- apostrophe followed by letter 40 | \x{2019}A -45 41 | 42 | --- 0 is correct: this cancels Adobe's ridiculous kerning 43 | \x{2019}[AÂdst] 0 44 | \x{2019}[[=a=][=e=][=o=]œ] 20 45 | [ccé][\x{2019}\x{201D}] 35 46 | \x{2019}[[=u=][=i=]] 50 47 | \x{2019}h 80 48 | \x{2019}[EÉIU] 100 49 | 50 | --- The following depend on three characters: in "f+space+[VWY}" there's not enough space between f and VWY 51 | f [VWY\x{201C}\x{2018}] 40 52 | ---\.\x20[VW] -160 53 | 54 | --- This one is similar, but kerns after the space rather than before it 55 | (?<=f) [VWY\x{201C}\x{2018}] 40 56 | 57 | --- Reduce space in A. W 58 | (?<=A)\. W -160 59 | (?<=a)\sV -120 60 | 61 | 62 | ===tabular_lining Regular 63 | 7~= -20 64 | 7[A\.] -100 65 | 66 | ===Italic 67 | T- -135 68 | T\x{0259} -90 69 | -[TW] -100 70 | -Y -80 71 | \x{2019}[[=a=][=e=][=o=]œ] 20 72 | \x{2019}[[=u=]] 50 73 | \x{2019}s 30 74 | \x{2019}[[=i=]] 100 75 | 76 | \x{2019}[IEOU] 100 77 | 78 | 79 | ===Semibold 80 | -A -80 81 | \x{2019}s 15 82 | 83 | ===Semibold Italic 84 | \x{2019}[[=a=][=e=][=o=]œ] 20 85 | 86 | ===Italic Regular 87 | f\) 180 88 | V\x{2019} 140 89 | [CF]\) 100 90 | [ld][’)] 100 91 | \l\x{2019} 90 92 | [grv][:;] 80 93 | \l\( 60 94 | [Vćilt]\) 60 95 | [DPbcders][:;] 60 96 | \l[:;] 40 97 | [dl]\] 40 98 | 99 | ===Regular Italic 100 | /A -80 101 | \(V -60 102 | r, -60 103 | 104 | ===Regular super 105 | f[123678] 160 106 | f[45] 140 107 | f[09] 200 108 | [VI]e 0 109 | [dl][\x{2019}\x{201D}] 60 110 | \x{2019}~F 100 111 | 112 | 113 | ===Regular otsuper 114 | [.,]\d -80 115 | 116 | ===Regular sub 117 | [VW][\l\d] -160 118 | [IH]\d -20 119 | P\d -80 120 | P[acegijmnopqrsuvwxyz] -130 121 | --- [aehiklmntuxz][ij] 40 122 | 123 | ===sub Regular 124 | f[[:punct:]] 150 125 | 126 | ===Italic super 127 | r\d 80 128 | Ve 50 129 | Xe 10 130 | 131 | 132 | ===Italic sub 133 | [IH][l\d] -60 -------------------------------------------------------------------------------- /Scripts/kern/kern_Times LT Std.txt: -------------------------------------------------------------------------------- 1 | --- Lines starting with three hyphens are ignored, --- can be used for comments 2 | --- Empty lines are ignored, too 3 | 4 | ===Roman 5 | '[m] -60 6 | [yw]~< -80 7 | 8 | --- Ligatures 9 | (?<=f)l[o] -35 10 | 11 | ===Roman Italic 12 | '[mt] -60 13 | 14 | ===Italic 15 | '[m] -60 -------------------------------------------------------------------------------- /Scripts/test.jsx: -------------------------------------------------------------------------------- 1 | #target InDesign; 2 | 3 | alert(typeof $.global.Sky); 4 | --------------------------------------------------------------------------------