rob day
Community Expert
rob day
Community Expert
Activity
Jun 10, 2025
Also, don’t know if it matters—there were 7 images on the pasteboard that the script deleted:
... View more
‎Jun 10, 2025
08:23 AM
Looks like you have some objects that are hidden, and a few with XY postions outside of the pasteboard. This gives a list of objects on the pasteboard and their XY positions:
var p = app.activeDocument.allPageItems;
var c = "XY:\r"
var x, y;
for (var i = 0; i < p.length; i++){
try {
if (p[i].parentPage == null) {
x = p[i].geometricBounds[0]
y = p[i].geometricBounds[1]
c = c + "X: " + x.toFixed(2) + " Y: " + y.toFixed(2) + "\r"
p[i].remove()
}
}catch(e) {
}
};
alert(c)
... View more
‎Jun 10, 2025
07:32 AM
Looks like there are some hidden objects on the pastboard. I ran this script to remove them, which dropped the file size from 100mb to 20mb and fixed the gap problem. I’ve attached the fixed file and here is the script:
var p = app.activeDocument.allPageItems;
var c = 0
for (var i = 0; i < p.length; i++){
try {
if (p[i].parentPage == null) {
p[i].remove()
c++
}
}catch(e) {
}
};
alert(c + " Items removed from the pasteboard")
... View more
‎Jun 10, 2025
03:32 AM
1 Upvote
Hi @Mary35352402nyxk , Can you share the IDML file?
... View more
‎Jun 09, 2025
01:34 PM
Hi @Jason33212095pso1 , Also, maybe to illustrate @Peter Spier and @Susan Culligan ’s post, the height your text frame in Points, set to the margins would have to be evenly divisible by 13.
Here the text frame height is 648 pt and the last line does not fit.
I have to set the text frame height to 650 (13 x 50) for the last line to fit in the frame and sit on the baseline. My baseline grid and leading would to be 12.96 (648/50) for a perfect fit to these margins
... View more
‎Jun 09, 2025
12:23 PM
Hi @Christian311349159u68 , Can’t help with the dead link, but there is the Indent to Here special character—Type > Insert Special Charater > Other > Indent to Here:
... View more
‎Jun 09, 2025
10:27 AM
2 Upvotes
Got the sample from @Eugene Tyson —does this work?:
//an array of texts with "Body-for-Table" para style
var ra = getTextStyleSearch("Body-for-Table");
var t, ln;
//reverse loop
for (var i = ra.length-1; i > -1; i--){
try {
//get the characters without the last return
ln = ra[i].characters.itemByRange(0,ra[i].characters.length-2);
ln.convertToTable();
}catch(e) {}
};
/**
* Search for a paragraph styles
* @ param fp the name of a paragrah style to search for String
* @ return result array
*/
function getTextStyleSearch(fp){
app.findTextPreferences = app.changeTextPreferences = app.findChangeTextOptions = null;
app.findTextPreferences.appliedParagraphStyle = fp;
return app.activeDocument.findText()
}
... View more
‎Jun 09, 2025
05:02 AM
Can you share a sample doc?
... View more
‎Jun 09, 2025
04:44 AM
1 Upvote
You can make the preview a bit larger by setting Row Size to Large. And you can customize the rows—here I’m showing Keywords and Page. The page number is a link, cliking it takes you to that page.
... View more
‎Jun 08, 2025
03:58 PM
Sorry, missed @Dave Creamer of IDEAS ’s post.
... View more
‎Jun 08, 2025
03:55 PM
I need to edit a document with 2 different languages,
Hi @samuelputla , Not sure if this is a problem for you, but there can only be one threaded Primary Text flow on a Parent Spread:
If I make the frame on the right page Primary, the 2 threaded frames on the left convert to regular text frames
... View more
‎Jun 08, 2025
03:40 PM
1 Upvote
When I use a photo, I label it
Hi @misty.v , Where is the lable? In the metadata? The Links panel lets you customize its column info—most of the metadata can be added.
... View more
‎Jun 08, 2025
03:18 PM
2 Upvotes
Hi @geirb9262873 , Maybe something like this:
//an array of texts with "Body-for-Table" para style
var ra = getTextStyleSearch("Body-for-Table");
var t;
for (var i = 0; i < ra.length; i++){
t = ra[i].convertToTable("\t","\r");
//assign a table style here?
//remove empty row at end?
t.rows.lastItem().remove();
};
/**
* Search for a paragraph styles
* @ param fp the name of a paragrah style to search for String
* @ return result array
*/
function getTextStyleSearch(fp){
app.findTextPreferences = app.changeTextPreferences = app.findChangeTextOptions = null;
app.findTextPreferences.appliedParagraphStyle = fp;
return app.activeDocument.findText()
}
... View more
‎Jun 07, 2025
11:32 AM
and I assumed scripting would offer more or less the same options as the UI!
It does. This would resize all the pages to A4.
app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS;
var p=app.activeDocument.pages
//the new width and height in points, A4 in this case
var w = 595.276
var h = 841.89
for (var i = 0; i < p.length; i++){
p[i].resize (CoordinateSpaces.INNER_COORDINATES,AnchorPoint.TOP_CENTER_ANCHOR,ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH,[w,h])
};
app.scriptPreferences.measurementUnit = AutoEnum.AUTO_VALUE;
... View more
‎Jun 06, 2025
01:02 PM
1 Upvote
The book exceeds 100Mb,
Hi @Don34862646jbr5 , 100MB doesn’t seem very large—I work on multi- TB Photshop files all the time.
Are you experiencing unexpected slow downs? Are all your images linked (not embedded)?
... View more
‎Jun 06, 2025
11:38 AM
You're telling me to sync all files twice in a row.
No, I’m really telling you to stop changing your Style Source document, which I don’t think has been mentioned in your other threads?
I used to do a lot of Book work 20 years ago when processing speeds made long, complex docs a challenge, and the complications of Book .indb files were worth it. I never changed the Sync source—its not that difficult to go to the source doc, edit a style or parent page, then Sync.
... View more
‎Jun 06, 2025
10:26 AM
1 Upvote
What do you expect to happen?
Prevent your Primary Text frame problems.
... View more
‎Jun 06, 2025
09:54 AM
1 Upvote
I think you would have to do a Sync before and after every snyc source change, and all you would have to do is forget once to potentially introduce a problem.
... View more
‎Jun 06, 2025
09:34 AM
If the document has been setup as facing pages there can be no separation between the pages with or without scripting. Most printed books are folded not cut at the spine prior to binding.
I don’t think you need a script. Select all the pages in the Pages panel then with the Pages tool selected change the width and height in the Transform panel. Here I’m changing the trim size from 8"x10" to 7"x9". Set your desired Referense Point an the Transform panel:
... View more
‎Jun 06, 2025
09:16 AM
In my main function you can run an if statement to check and act on the result
function main(){
//if the check box is checked
if (ck) {
alert("Skip First Head")
//code to skip here
} else (
alert("Allow First Head")
//code to allow here
)
}
... View more
‎Jun 06, 2025
08:47 AM
Hi @dublove , There are two ways to make dialogs with the JS API I prefer this one:
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#DialogColumn.html
There’s also the Window class but it think it is harder to learn
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#WindowSUI.html
Here is a simple checkbox example:
//the checkbox result variable
var ck
makeDialog();
/**
* Make the dialog
*/
function makeDialog(){
var d = app.dialogs.add({name:"Table Headers", canCancel:true});
with(d){
with(dialogColumns.add()){
staticTexts.add({staticLabel:"Skip Headers:"});
}
with(dialogColumns.add()){
ck = checkboxControls.add({checkedState:false, minWidth:150});
}
}
if(d.show()){
//get the result
ck = ck.checkedState;
main()
}else{
d.destroy();
}
}
/**
* The Script to run after getting dialog result
* @ return void
*/
function main(){
alert("Dialog Results\ncheck box= "+ ck)
}
... View more
‎Jun 06, 2025
08:22 AM
For me a regular double click with no delay on a Layer name (not a page item name) opens the Layer Options dialog.
So for a Layer (not a page item) the delay seems to have a needed function—for a simple rename you might want to skip the Layer Options dialog?
... View more
‎Jun 06, 2025
08:05 AM
but you could also double click on a layer name
Hi @Flo_8580 , I think @solidvision is refuring to a Layer’s page item list—Layers are a document property while the page item list is a list of items on the active spread.
There does need to be a delay beteen the clicks when you double-click a page item name in order to edit the name.
... View more
‎Jun 06, 2025
07:43 AM
1 Upvote
When I try this I'm getting the "glued to spine" effect!
Sorry I missed @Manan Joshi post. Facing page docs always have a spine imitating a (glued or sewn) bound book’s spine. You can setup a non facing page document as spreads and pull the pages apart—in that case the script would do this
... View more
‎Jun 06, 2025
07:32 AM
Hi @ukzembla , There is the resize method. This sets the active page to 300 x 600 points using a top center anchor
app.scriptPreferences.measurementUnit = MeasurementUnits.POINTS;
var p=app.activeWindow.activePage
//the new width and height in points
var w = 300
var h = 600
//resize using top center anchor
p.resize (CoordinateSpaces.INNER_COORDINATES,AnchorPoint.TOP_CENTER_ANCHOR,ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH,[w,h])
app.scriptPreferences.measurementUnit = AutoEnum.AUTO_VALUE;
... View more
‎Jun 06, 2025
03:17 AM
That's why I make the style source the document I'm working on
If you change the Style Source to the active document every time you make an edit, you have effectively eliminate the feature—there would be no need for a Style Source if the active document always acts as the source when you sync. If you really want to do that run a Sync before you swich sources.
... View more
‎Jun 05, 2025
03:11 PM
I also set the book "sync source" to the file I'm working on.
I would expect that might cause your problems. You should choose a single book file to act as the Style Source. If you want to change all the book’s masters and styles do it from the chosen Style Source document then sync to get the other documents’ masters and styles to match.
... View more
‎Jun 05, 2025
08:57 AM
Hi @Tagore Editora , Have you tried clearing your prefs and caches?
... View more
‎Jun 05, 2025
08:26 AM
With a Book I can get it to happen if I check Parent Pages in the Book panel’s Synchronize Options, and then make a change to the Primary Frame of one of the document’s that is not the sync source document.
You might think about not checking Parent Pages in Sync Options, or only make a Parent page change to the Sync Source document
If you do include Parent Pages make sure you only make Parent Page edits to the sync master
... View more
‎Jun 04, 2025
06:33 PM
Any chance you are deleting and remaking the Primary Text Fames on the Parent Pages after you added text to the pages? That could do it.
... View more