-
1. Re: A simple script for you, a giant script for me…
[Jongware] Apr 22, 2011 4:19 AM (in response to Maria964)Maria964 wrote:
2. A loop that goes through every text frame in the spread and, at the end of the text contained in each of those frames inserts a blank paragraph.Are those text frames threaded together? If so, then I'm pretty sure that will cause problems when you try to add a return at the end.
(And if not, this should be a piece of cake!)
-
2. Re: A simple script for you, a giant script for me…
Maria964 Apr 22, 2011 4:40 AM (in response to [Jongware])Hi Jongware,
No, they are not. That is going to be the second part of my work but it is a very complex layout and therefore is not scriptable.
Thank you in advance.
Maria
-
3. Re: A simple script for you, a giant script for me…
John Hawkinson Apr 22, 2011 5:10 AM (in response to Maria964)I like scripts very much but scripting does not seems to like me! Can anyone help me and write a script for me? What I need is this:
It's much easier for you to show us what you have and then we'll fix it for you or tell you what is wrong. Then you'll learn something to!
1. Ungroup everything in a spread
This one's easy -- unless you're worried about groups inside groups?
app.activeWindow.activeSpread.groups.everyItem().ungroup()
If it's groups all-the-way-down, on the other hand, well, it might be more than one line...
-
4. Re: A simple script for you, a giant script for me…
Kasyan Servetsky Apr 22, 2011 5:34 AM (in response to Maria964)If I got you right, Maria, you want something like this:
var i, textFrames, textFrame, spread = app.activeWindow.activeSpread; spread.groups.everyItem().ungroup(); textFrames = spread.textFrames; for (i = 0; i < textFrames.length; i++) { textFrame = textFrames[i]; textFrame.insertionPoints.lastItem().contents = "\r"; }Kas
-
5. Re: A simple script for you, a giant script for me…
Maria964 Apr 22, 2011 1:52 PM (in response to Kasyan Servetsky)Thank you John and thank you Kasyan.
Kasyan script work like a charm. It is going to save me a lot of work
Nice week end
Maria
-
6. Re: A simple script for you, a giant script for me…
Maria964 Apr 22, 2011 3:11 PM (in response to Maria964)Hey Kasyan,
I have forgotten one thing :
Can you make this script loop through all the spreads of the active publication and in the end allert that the work is done?
Thank you again....
-
7. Re: A simple script for you, a giant script for me…
John Hawkinson Apr 22, 2011 6:08 PM (in response to Maria964)Just make a loop over spreads in the document, like this:
var i, j, textFrames, textFrame, spread; for (j = 0; j < app.activeDocument.spreads.length; j++) { spread = app.activeDocument.spreads[j]; spread.groups.everyItem().ungroup(); textFrames = spread.textFrames; for (i = 0; i < textFrames.length; i++) { textFrame = textFrames[i]; textFrame.insertionPoints.lastItem().contents = "\r"; } }But I still think you should tell us what you tried and how it didn't work.




