giovanni_4827
Community Beginner
giovanni_4827
Community Beginner
Activity
‎Mar 20, 2025
08:04 AM
I solved using textFrame.fit(FitOptions.CONTENT_TO_FRAME);
textFrame.fit(FitOptions.CENTER_CONTENT);
... View more
‎Mar 20, 2025
08:01 AM
Hello, i insert a PDF but i'm not able to resize it to fit a certain dimension. My code is: var pdf = textFrame.place(myPDFPath);
textFrame.fit(FitOptions.CENTER_CONTENT); That center the pdf in the page but I can't resize it. I tried pdf.resize but without success I'm using Indesign CS5.5
... View more
‎Mar 13, 2025
05:37 AM
Works perfectly! Thanks!
... View more
‎Mar 13, 2025
04:06 AM
parent is Doc and doesn't have texts If I use var sto = tp.parentStory;
var txt = sto.texts[0];
var start = tp.storyOffset.index;
var charactersToDelete = txt.characters.itemByRange(start, start+tp.length-1);
charactersToDelete.remove(); I always have invalid object I have a conceptual doubt , if storyOffset.index is regarding the story in the cell (and that's right, with 2char before in the cell it says 2) if I start referencing the entire table it should count also other cells values so a bigger number. Maybe the path is right, but i'm missing the right offset. Thanks
... View more
‎Mar 13, 2025
12:55 AM
It seems i can't upload the script, following the code: #target indesign
var doc = app.activeDocument;
var tp = doc.dataMergeTextPlaceholders[0];
var sto = tp.parentStory;
var start = tp.storyOffset.index;
var charactersToDelete = sto.characters.itemByRange(start, start+tp.length-1);
charactersToDelete.remove();
alert("OK");
... View more
‎Mar 13, 2025
12:52 AM
Hello, i first realized the correct usage is using tp.storyOffset.index But I'm still having the same problem. Attached a file, script and txt to reproduce the problem. I'm using CS5.5. I think the problem is related to the table, because testing in a standard text box it works Thanks PS: is theren't a way to EDIT the placeHolder instead of removing and readding it?
... View more
‎Mar 12, 2025
09:35 AM
Hello, i want to modify programmatically a DataMergeTextPlaceholder changing the field with another, but the field attribute is RO. I tried to delete it to add another later using https://www.indesignjs.de/extendscriptAPI/indesign-latest/index.html#DataMergeTextPlaceholders.html#d1e73552__d1e73601 but i have errrors because the object is invalid. var tp = doc.dataMergeTextPlaceholders[3];
var sto = tp.parentStory;
var charactersToDelete = sto.characters.itemByRange(tp.index, tp.index+tp.length-1);
charactersToDelete.remove() Thanks
... View more
‎Mar 12, 2025
12:41 AM
Putting the ; make no difference. If i remove the part to remove preview i have an error if the user have the preview enabled. Operazione di scripting di Unione dati rifiutata. Il pannello Unione dati è chiuso oppure è ridotto e l'anteprima è attiva. translating is something like "merging rejected. Data merge panel is closed or minimized or the preview is enabled" Testing that part of code seems to work, and it simply disable the preview. I found the problem, or at least a solution, with a relative path it works (and it saves on Documents). What I'm still missing is how to understand last recordNumber (Number of file rows) or the source of the data for the merge. In the script (and also AI sites) suggests to use DataMergePreference.recordRange but it's the range selected to merge, nothing regards last available How to read a value associated to a merge field and a selected record
... View more
‎Sep 09, 2024
07:21 AM
I'm using InDesign CS5.5 and the ExtendScript Toolkit 4.1.28 I want to change the color, size and line spacing of a ToC after the update I used var toc = ... // my Story
toc.textContainers[0].select()
app.menuActions.item("$ID/UpdateTableOfContentsCmd").invoke();
toc.texts[0].fillColor = "Black"; // it Works
toc.texts[0].appliedParagraphStyle.pointSize = 7; // applied only to the first row
var parStyle = toc.texts[0].appliedParagraphStyle;
parStyle.pointSize = 7;
toc.texts[0].applyParagraphStyle(parStyle); // Applied to all, but the entire style including underline and so on, not only the font size
var paragraphs = toc.paragraphs
for (var i = 0 ; i < paragraphs.length; i++ ) {
paragraphs[i].appliedParagraphStyle.pointSize = 7; // not working
}
How can I set the font size and the line spacint to the entire object? (title + ToC) Manually i enter in the textBox, I click Ctrl+A (Select ALL) and I use the two forms as shown Thanks
... View more
‎Sep 09, 2024
04:24 AM
My bad, it's under layout. In the screenshot above it's italian. If i click update there are no prompt. If I can find how to check if a TextFrame has a Story, how can I update it? Thanks!
... View more
‎Sep 09, 2024
03:42 AM
Hello, i'm trying to make a javascript script to find update an index but i'm stucked. I'm using InDesign CS5.5 and the ExtendScript Toolkit 4.1.28 I have an indb file and many indd, I can locate the right file indd and open it with app.open. I tried to look at indexes but they are always 0, I also tried to check textFrames to find the right one but without success. I looked for a way to inspect the document to identify the structure but i can't find anythin better than randomly checking elements with the debugger. I manually update the index selecting the textbox and then with Edit -> Update index Can you help me to aumate it? Thanks
... View more