-
1. Re: [JS] Move Footnotes
pkahrel Feb 28, 2012 9:18 AM (in response to Philippe Ruelle)Footnotes have a property storyOffset, which gives you the position of a note marker within a note's parent story. Use the move() method to move the footnote somewhere else (in the example below, to the end of the story):
myStory = app.documents[0].stories[0];
myFn = myStory.footnotes[0];
myStory.characters[myFn.storyOffset.index].move(LocationOptions.after, myStory.characters[-1]);
Peter
-
2. Re: [JS] Move Footnotes
Philippe Ruelle Feb 28, 2012 12:00 PM (in response to pkahrel)thank you Peter
this code gives me the error code:
"Invalid Item"
thank you
I test to see the problem.Merci
ce code me donne le code erreur :
"Objet non valide"
merci
je test pour voir le problème.
-
3. Re: [JS] Move Footnotes
Philippe Ruelle Feb 28, 2012 12:32 PM (in response to Philippe Ruelle)Thank you, here is what I wanted to get my notes move footer.
Merci, voici à quoi je voulais arriver déplacer mes notes de bas de page.
#target indesignvar myStory = app.selection[0].parent;var mesNotes = myStory.footnotes;for (i=0; i< mesNotes.length-1; i++) {myStory.characters[mesNotes[i].storyOffset.index].move(LocationOptions.after, mesNotes[i+1].storyOffset);} -
4. Re: [JS] Move Footnotes
[Ariel] Feb 28, 2012 1:00 PM (in response to Philippe Ruelle)myFootnoteMarker.move(LocationOptions.BEFORE, anotherCharacter);
myFootnoteMarker is a character -- the footnote marker that you want to
move.
Check out LocationOptions to see what your other options are.
anotherCharacter is where you want to move it to -- could also be an
insertionPoint etc.
Could be that I've got the order of the parameters the wrong way round
or that there are other params as well (i.e. first anotherCharacter then
LocationOptions) -- check it out in the help.
HTH,
Arie
-
5. Re: [JS] Move Footnotes
pkahrel Feb 29, 2012 4:15 AM (in response to Philippe Ruelle)Philippe,
Your 'undefined' error is probably caused by overrunning the footnote collection. At the last iteration of the for-loop, mesNotes[i+1] is a non-existent note. To avoid that, use this
for (i=0; i< mesNotes.length-1; i++)Another thing is: what are you trying to do? It seems to me that all that your code does is to move the first footnote.
Peter
-
6. Re: [JS] Move Footnotes
Philippe Ruelle Feb 29, 2012 7:06 AM (in response to Philippe Ruelle)Thank you Peter,
The error was a poor selection of the block ... but actually there is a problem with the last note
To import a word file, the contents of notes (1,500 notes) are shifted.Merci Peter,
L’erreur était une mauvaise sélection du bloc … mais effectivement il y a un problème avec la dernière Note
À l'importation d'un doc word, le contenu des notes (1500 note) ce sont décalé.
-
7. Re: [JS] Move Footnotes
pkahrel Feb 29, 2012 10:33 AM (in response to Philippe Ruelle)Philippe,
You still haven't told uis what you want to do. Where do you want to move the notes to?
By the way, it is rarely necessary to select anything in a script. If you're selecting all notes in a story, then simply target that story.
Peter
-
8. Re: [JS] Move Footnotes
Philippe Ruelle Feb 29, 2012 11:10 AM (in response to pkahrel)Peter,
"You still haven't told uis what you want to do. Where do you want to move the notes to?"
The content of the notes that are offbeat, such as the text of footnote 2 is found in Note 1, Note 3 of the in Note 2 etc ...
"By the way, it is rarely necessary to select anything in a script. If you're selecting all notes in a story, then simply target that story."
Exact, I have not always good reflex ... but I'm learning
thank you
I use Google to translate my french!
-
9. Re: [JS] Move Footnotes
pkahrel Feb 29, 2012 1:05 PM (in response to Philippe Ruelle)Ah. You don't want to move note markers, but the note text from onr note to the next. That would be something like this:
meNotes[i].texts[0].move (LocationOptions.after, mesNotes[i+1].insertionPoints[0]);
but you must make sure that you work in the correct direction. You should probable do it the other way around:
meNotes[i].texts[0].move (LocationOptions.after, mesNotes[i-1].insertionPoints[0]);
Peter
-
10. Re: [JS] Move Footnotes
[Jongware] Feb 29, 2012 1:56 PM (in response to pkahrel)No, that would paste the text at the end of the previous note!
FIRST you need to add an empty note at the end, THEN loop back from last-but-one note to the first, moving each note's contents to the next one.
-
-
12. Re: [JS] Move Footnotes
Philippe Ruelle Mar 1, 2012 12:24 PM (in response to Philippe Ruelle)If my case, the version of the script very well to hand over notes (1500) to their seats, Super#target indesignvar myStory = app.selection[0].parent;var mesNotes = myStory.footnotes;for (i=1; i< mesNotes.length-1; i++) {myStory.characters[mesNotes[i].storyOffset.index].move(LocationOptions.after, mesNotes[i+1].storyOffset);//mesNotes[i].texts[0].move (LocationOptions.after, mesNotes[i-1].insertionPoints[0]);}again thank you



