Forum Replies Created
-
AuthorPosts
-
Kai Rübsamen
MemberAaron, if this is working for you, I don’t need additional testfiles.
Oleh, I’m not sure, if this is a bug or simply the behavior of collections.Kai
Kai Rübsamen
MemberTHIS is your problem! ;-) Spanning columns divide your document technically in layoutzones or textframes inside of textframes. Because footnotes are always at the bottom of a textframe, they are – in this case – at the bottom of a layoutzone.
Solution: Avoid spanning columns. Use different styles for space before / after.
Kai
Kai Rübsamen
MemberHaha, I had in the meantime 3 different samples and get different results, if I move forwards or backwards, but not any solution give the right results ;-)
First, you should remove your while loop. Second use a static array instead of your dynamic collection. This simplified example works for me in any solution:
var curDoc = app.activeDocument; var objectStyleName = "Red Style"; var layerName = "Red Layer"; var pItems = curDoc.pageItems.everyItem().getElements(); var nItems = pItems.length; for (var i = 0; i < nItems; i++) { var curItem = pItems[i]; if (curItem.appliedObjectStyle.name == objectStyleName && curItem.itemLayer.name != layerName) { // move objects to layer curItem.itemLayer = curDoc.layers.itemByName(layerName); } }Kai Rübsamen
MemberOleh, did you package the right files? Locked objects are not moved, if you choose move red to red, yellow is moved as well, but not on page 1. Objects with basic frame applied are moved on page 1 too ;-)
Kai Rübsamen
MemberAaron, you could sent me a file directly to forum@ruebiarts.de. Otherwise you should built an example with bla bla text ;-)
> However, I also find that some other objects that don’t have that style are also moving to the selected layer.
Hm, I cannot believe that, cause in Olehs script there is a line, that should prevent that!
Kai Rübsamen
MemberOleh, weird indeed!
Assume you have one page with 4 items.
pageItems[0] > wrong style
pageItems[1] > right style to move
pageItems[2] > right style to move
pageItems[3] > wrong styleIf you move forwards within a collection you should get the following result:
pageItems[1] is moved to the new layer, but if you check the index of this object, the index is now [3]. That means, the previous [2] becomes [1] and will be ignored (!), and the previous [3] is now [2] and fails, because of the wrong style. But the previous [1] whos index is now [3] will be examined again.
This will not happen (normally), if you loop backwards or if you deal with pI = app.activeDocument.pageItems.everyItem().getElements() as static array forwards.
However: I had some issues with forwards or backwards in the past too ;-)
Kai Rübsamen
MemberAaron sent his testfile only to you. So I built a simple sample: 4 pages as spreads. Page 1 and 4 alone, page 2+3 on one spread. If there are more than one objects with applied oStyle per spread, only one object will be moved to the new layer, if you move forwards. If you move backwards all objects are moved.
But you are right: I had sometimes problems with forward and backward loops, if I use collections. So sometimes it is helpful to deal with arrays instead. Maybe Aaron should built a example, that is available for everyone here.
Kai Rübsamen
MemberOleh, why didn’t you loop backwards as suggested?
Kai Rübsamen
MemberYou must use a unic identifier. Years ago, I overwrite this with the ISBN, but if you crack up your EPUB, then you will see, that this isn’t correct. Today I leave it as it is and do not include a addtional ISBN. Therefore I can use the EPUB for Kindle (>mobi) and iBooks.
Kai Rübsamen
MemberAaron, if you open the script with a Texteditor or the ESTK you will find a line something similar to the new line. Simply change it. But this will maybe not solve your error. Because Oleh write here too, I’m pretty sure, he will correct his script and provide a new download link :)
Kai Rübsamen
MemberYou get inconsistent results, because the index per spread is messed up when the first frame is moved. Looping backwards will help here:
for(i = app.activeDocument.textFrames.length-1; i >= 0 ; i–)
Kai Rübsamen
MemberAaron, Olehs script is working for me. I get only an error, if a object is locked. Can you identify the situation when his script fails? Provide an example?
Kai
Kai Rübsamen
MemberHi,
There is a training on that topic at lynda.com from Michael Murphy. The trick is, to map content to tags and give them a order for the export. Another problem is maybe, that mail-programs use usually tables instead of divs.
If you know exactly what you want, you will get the right HTML with some preparation. Note, that you will get terrible CSS!
Kai
April 17, 2018 at 11:46 pm in reply to: Assigning InDesign properties on anchored objects when importing XML #103136Kai Rübsamen
MemberAs far as I know, this is not possible during the import.But you can after placing your file on the page loop through you contents and set those properties with scripting. In this case, the different length of images and tables in your docs doesn’t matter.
Kai Rübsamen
MemberClark, do you have one or more lines? If you have one line, the you can enter in the automatic toc ^n^t for Shift return and tab, set leading to 0 and control the aligment and space with the applied para style.
If you have more than one line, this could be done with some lines of scripting.
Kai
-
AuthorPosts
