Forum Replies Created
-
AuthorPosts
-
Peter KahrelParticipantclearObjectStyleOverrides removes object style overrides, not paragraph overrides. Maybe try
app.activeDocument.textFrames[0].paragraphs.everyItem().clearOverrides(OverrideType.ALL);
Peter KahrelParticipantHi Kai,
> you cannot target footer rows directly?!
Well, in a way you can:
The nth footer row in a table:
myTable.rows [myTable.headerRowCount + myTable.bodyRowCount + n-1]
Peter
Peter KahrelParticipantCheck the object model in some viewer. clearOverrides() is not a property or function of text frames, only of text objects (words, characters, lines, etc).
Peter KahrelParticipantTry changing this line:
app.findGrepPreferences.findWhat = “”+abbrevs[a][1]+””;
to
app.findGrepPreferences.findWhat = “”+abbrevs[a][1]+”(?!,)”;
which translates as ‘Find tw-letter abbreviations not followed by a comma’. It may still find things you’re not after, so click ‘Find next’ a few times to see what you get.
P.
Peter KahrelParticipantSteve,
I think that this script allows you to do what you want: https://www.kahrel.plus.com/indesign/price_adjuster.html
The script is a combination of Steve Wareham’s number adjuster and Olav Kvern’s price updating scripts with some embellishments. It handles more thousand seperator symbols than just comma and dot,so it may work for you.
Peter
Peter KahrelParticipant> I would guess you wouldn’t replace the template with an indesign file as they have differing extensions.
Correct.
> So wouldn’t you end up with a template file and a new indesign file by running this script?
Correct.
Peter KahrelParticipantMaybe look around here: https://kasyan.ho.com.ua/scripts_by_categories.html
This is not my web site, it’s Kasyan Servetsky’s. If you can’t find what you’re looking for, write to him, his contact address is on his web site.
Peter KahrelParticipantThis is a good starting point:
https://www.safaribooksonline.com/library/view/scripting-indesign-cs34/9780596803599/
It has CS3/4 in its title, but scripting has hardly changed in recent since then.
Peter
Peter KahrelParticipantThe script to do this on a single document is this simple one-liner:
app.documents[0].pages[0].appliedMaster = app.documents[0].masterSpreads.item ('A-Master');Doing that on 300+ documents is a little trickier. You have two options:
https://kasyan.ho.com.ua/batch_process_scripts/batch_process_scripts.html
https://www.kahrel.plus.com/indesign/batch_convert.htmlPeter
Peter KahrelParticipantTake a look at this script:
https://kasyan.ho.com.ua/place_images.html
It shows how to place images using a loop and how to get files from folders and subfolders. It’s unlikely to do exactly what you you’re after, but there’s enough there to give you ideas and to keep you busy for a while :)
Peter KahrelParticipantIf you’re going to place images using a loop, you have to know beforehand where those images should be placed. For instance, image 1 on p. 10, image 2 on p. 11, image 3 on p. 12, etc. Or images go to rectangles named after the images on the Layers panel. E.g. img01.jpg is placed in myDoc.rectangles.item(‘img01’), img02.jpg in myDoc.rectangles.item(‘img02’), etc. The placement that you gave in your first post:
myDoc.pages[11].rectangles[0].place(myImg01, false);
myDoc.pages[12].rectangles[0].place(myImg02, false);
myDoc.pages[12].rectangles[1].place(myImg03, false);
myDoc.pages[13].rectangles[0].place(myImg04, false);is (probably) not predicatable and/or consistent: how do you know which images are placed on which rectangle on which page?
P.
Peter KahrelParticipantIf you have four images I wouldn’t bother with a loop.
> I intend to expand the script later, so my next question would probably be how do I make the loop go through multiple folders
That’s a long and non-trivial story. . .
Peter KahrelParticipantHow many images are there to place? And how do you know that 2 and 3 are on one page, and 1 and 4 not?
Peter KahrelParticipantHi Mike — Actually, there’s no need to create new file objects separately. You can do it as follows:
var template = app.open (File ('~/Desktop/test.indt'));
// Do stuff
template.save (File('~/Desktop/test01.indd'));
template.close();Peter
Peter KahrelParticipant> In what sequence js reaches each text frame?
In what way ‘next’? If you mean the next threaded frame, then nextTextFrame returns a frame’s next frame:
frame = myTextFrame.nextTextFrame;
With unthreaded frames, as Lindsey mentions, their indexes reflect the order of creation.
-
AuthorPosts
