Forum Replies Created
-
AuthorPosts
-
Ari Singer
MemberYou don’t have to learn scripting yourself. You can hire someone for that.
Ari Singer
MemberCopied and pasted from here:
“Choose Edit > Spelling > Dictionary.
In the Language menu, choose a language. Each language contains at least one dictionary.
In the Target menu, choose the dictionary where you want to store the word. The Target menu lets you store the changes in an external user dictionary or in any open document.
In the Dictionary List menu, choose Added Words.
Click Hyphenate to see the words default hyphenation. Tildes (~) indicate possible hyphenation points.
In the Word box, type or edit the word to be added to the word list.
If you dont like the hyphenation points, follow these guidelines to indicate your preferred hyphenation of the word:
Type one tilde (~) to indicate the best possible hyphenation points, or the only acceptable hyphenation point, in the word.
Type two tildes (~~) to indicate your second choice.
Type three tildes (~~~) to indicate a poor but acceptable hyphenation point.
If you want the word never to be hyphenated, type a tilde before its first letter.”Ari Singer
MemberYou don’t have to click away, just double-click the page.
Ari Singer
MemberIt takes a tab-delimited text file. The first value is the height, and the second is the width. Only use numbers and don’t add measurement units (such as “mm”). The measurement units will be defined by your InDesign defaults. First the script prompts you to select the text file, and then it prompts you again to select the folder where you want the resulting files to be saved.
–Ari
Ari Singer
MemberMy posts are not going through, so I’ll try one more time:
var file = File.openDialog("Select Your Text File", undefined, false); var folder = Folder.selectDialog("Select the folder where the new documents should be saved"); file.open("r"); var content = file.read().split(""); for (var i = 0; i < content.length - 1; i++) { var curLine = content[i].split(""); var h = curLine[0]; var w = curLine[1]; docName = h + " x " + w; try { var newDoc = app.documents.add(false); newDoc.documentPreferences.pageHeight = h; newDoc.documentPreferences.pageWidth = w; newDoc.save(new File(folder + "/" + docName + " .indd")); newDoc.close(SaveOptions.no) } catch(myError){} }Ari Singer
MemberDavid Blatner has Harbs’ personal email address, ask him if he wants to give it to you.
Ari Singer
MemberWord can bring along a lot of garbage paragraph and character styles. Iv’e had similar situations like yours and usually I found that the text had a character style applied that came along from Word! So make sure no character styles are applied, and if they are delete them ASAP.
Ari Singer
MemberJust wondering: Is Section 1.3 in the same thread as Section 1.2 and Section 1.1?, or is it in a separate thread? This can sometimes be the problem.
Ari Singer
MemberMake sure you did correctly, because by me it works.
Create a character style that has color, bold and underline attributes. Then within the paragraph style that you want to apply this to, go to GREP styles. From the dropdown menu select your character style you just created and in the “To Text” filed enter this query:
.+(?= – ).Make sure that you copy and paste the code correctly.
Ari Singer
MemberTry this GREP style:
.+(?= – )Ari Singer
MemberYep! You’re right!
What happened was that when I copied your “Change To” string, along came a preceding space! (I should’ve been more careful, because this happens so often!). It does work now as expected. Thanks!
Ari Singer
MemberTake the first entry (“Bacs à plantes en béton”)for an example. After I ran the GREP the maximum amount of times, it still is divided in two entries. The culprit seems to be a space that was added in the process at the beginning of the first entry. But this occurs throughout the document with multiple entries.
Ari Singer
MemberI fixed the script to use only frames, and not the inner objects in them, so not to duplicate the label frames. I also made sure that when the script ends executing, the active layer is not the “InfoLayer” so you don’t mistakenly put important objects on this layer (it gets deleted every time the script runs).
app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Get XY Coords"); function main() { var myDoc = app.activeDocument; var myPages = myDoc.pages; var myLayers = myDoc.layers; for (var k = 0; k < myLayers.length; k++) { if (myLayers[k].name == "Info Layer") myLayers[k].remove(); break; } var myObjectStyle; var myParaStyle; myDoc.layers.add({name: "Info Layer"}); try { myParaStyle = myDoc.paragraphStyles.item("InfoStyle"); myParaStyle.name; } catch (myError){ myParaStyle = myDoc.paragraphStyles.add({name:"InfoStyle", pointSize:10, leading:14, noBreak: true}); } try{ myObjectStyle = myDoc.objectStyles.item("InfoFrame"); myObjectStyle.name; } catch (myError){ myObjectStyle = myDoc.objectStyles.add(); with(myObjectStyle) { name = "InfoFrame"; basedOn = "[None]"; enableFrameFittingOptions = true; enableAnchoredObjectOptions = false; enableFill = false; enableParagraphStyle = true; enableStroke = false; enableStrokeAndCornerOptions = false; enableTextFrameAutoSizingOptions = true; enableTextFrameGeneralOptions = true; enableTextWrapAndOthers = false; myObjectStyle.textFramePreferences.autoSizingType = AutoSizingTypeEnum.HEIGHT_AND_WIDTH; myObjectStyle.textFramePreferences.autoSizingReferencePoint = AutoSizingReferenceEnum.BOTTOM_LEFT_POINT; myObjectStyle.appliedParagraphStyle = myParaStyle; } } for (i = 0; i <myPages.length; i++) { var allStuff = myPages[i].allPageItems; for (j = 0; j < allStuff.length; j++) { var curStuff = allStuff[j]; if ((curStuff.constructor.name == "Image") || (curStuff.constructor.name == "PDF") || (curStuff.constructor.name == "ImportedPage")) { continue; } var myBounds = curStuff.geometricBounds; var myY = myBounds[0]; var myX = myBounds[1]; var myH = myBounds[2] - myY; var myW = myBounds[3] - myX; var myString = "Y: " + myY.toFixed(1) + " X: " + myX.toFixed(1) + " H: " + myH.toFixed(1) + " W: " + myW.toFixed(1); var myFrame = myPages[i].textFrames.add(); myFrame.geometricBounds = [(myY - 5), myX, (myY - 2), (myX + 1)]; myFrame.appliedObjectStyle = myObjectStyle; myFrame.contents = myString; } } myDoc.activeLayer = myDoc.layers[1]; }Ari Singer
MemberSorry, Kai. Did not notice that line. It’s faster than a script but has its drawbacks as well. I tried it on the TOC that he provided and the results weren’t perfect.
July 4, 2016 at 5:55 pm in reply to: package for output – single pages, from a multi page document #86258Ari Singer
MemberSorry for making you crazy with these extra-long scripts, but I finally fixed it, and I recommend you use the new code.
Now the script honors blank pages and packages it along (so books and the like don’t get messed up).//created by Ari S. -- designerjoe@outlook.com // Package entire document individually by the amount of pages at a time that you want app.scriptPreferences.enableRedraw = false; var srcDoc = app.activeDocument; var srcTitle = srcDoc.name; var srcPages = srcDoc.pages; var pgLength = srcPages.length; var srcW = srcDoc.documentPreferences.pageWidth; var srcH = srcDoc.documentPreferences.pageHeight; var srcPgLength = srcPages.length; var start = 0; var range, end, newDocName, isEnd, fileName; // ------- HERE YOU CAN CHANGE ANY PACKAGING SETTING THAT YOU WANT. TRUE means 'ON', and FALSE means 'OFF': --------- var copyingFonts = true; var copyingLinkedGraphics = true; var copyingProfiles = true; var updatingGraphics = true; var includingHiddenLayers = true; var ignorePreflightErrors = true; var creatingReport = true; var includeIDML = true; var includePDF = false; var pdfStyle = ""; var forceSave = true; var myDialog = app.dialogs.add({name:"Package Export Range", canCancel:true}); with (myDialog) { with(dialogColumns.add()) { with(dialogRows.add()) { staticTexts.add ({staticLabel:"Enter the amount of pages you want to package at a time"}); with(dialogRows.add()) { var myRangeBox = integerEditboxes.add({editValue:1}); } } } } if (myDialog.show() == true) { range = myRangeBox.editValue; if (range == 0) { alert("0 is not a range!..."); myDialog.destroy(); exit(); } else if (range > pgLength) { alert("Range can't be more than the amount of pages"); myDialog.destroy(); exit(); } run(); } else { myDialog.destroy(); exit(); } function run() { while (!isEnd) { var newDoc = app.documents.add({pageWidth: srcW, pageHeight: srcH}); newDoc.masterSpreads[0].baseName = "garbage_master"; end = start + range; if (end >= srcPages.length) { end = srcPages.length; isEnd = true; } var firstPage = srcPages[start]; var lastPage = srcPages[end - 1]; for (var j = start; j < end; j++) { var srcPage = srcPages[j]; var newPage; if (j == start) { newPage = srcPage.duplicate(LocationOptions.BEFORE, newDoc.pages[0]); for (var k = newDoc.pages.length - 1; k > 0; k--) { newDoc.pages[k].remove(); } } else { newPage = srcPage.duplicate(LocationOptions.AFTER, newDoc.pages[-1]) } srcMaster = srcPage.appliedMaster; var newMaster; try { newMaster = newDoc.masterSpreads.item(srcMaster.name); newMaster.name; } catch (myError) { newMaster = srcMaster.duplicate(undefined, newDoc); } newPage.appliedMaster = newMaster; } newDoc.masterSpreads[0].remove(); if (firstPage.side === PageSideOptions.LEFT_HAND) { newDoc.documentPreferences.startPageNumber = 2 } if (newDoc.pages.length == 1) { fileName = "Page " + firstPage.name; } else { fileName = "Pages " + firstPage.name + " - " + lastPage.name; } createPackage(newDoc); start += range; if (start == srcPages.length) { isEnd = true; } } } function createPackage(myNewDoc) { var targetFolder = new File("~/Desktop/" + srcTitle +"/" + fileName + "/"); var flag = Folder(targetFolder).create(); var versionComments = srcTitle + " " + fileName; if ( flag === true){ var garbageFolder = new File("~/Desktop/" + srcTitle +"/Delete This Folder/"); Folder(garbageFolder).create(); myNewDoc.save(new File("~/Desktop/" + srcTitle + "/Delete This Folder/" + fileName + ".indd")) myNewDoc.packageForPrint ( targetFolder, copyingFonts, copyingLinkedGraphics, copyingProfiles, updatingGraphics, includingHiddenLayers, ignorePreflightErrors, creatingReport, includeIDML, includePDF, pdfStyle, versionComments, forceSave); myNewDoc.close(SaveOptions.no); var myTempFiles = Folder(garbageFolder).getFiles(); for (l = myTempFiles.length - 1; l >= 0; l--) { myTempFiles[l].remove(); Folder(garbageFolder).remove(); } } } -
AuthorPosts
