Forum Replies Created
-
AuthorPosts
-
Aaron Gray
ParticipantKai: Do you still want a test file? It sounds like you’re getting exactly the same results I was. However, I downloaded your simplified script, changed the object style and layer names to match the stuff I wanted to move, and it seems like it’s working fine. That may be all I need to solve my problem. Thanks!
Aaron Gray
ParticipantThanks, Kai! I didn’t get a chance today but I will send something your way next week.
Aaron Gray
ParticipantI tried the latest version and I’m still getting inconsistent results, but now in a different way. I’m finding that the objects with the object style I’ve selected are consistently moving to whichever layer I select. However, I also find that some other objects that don’t have that style are also moving to the selected layer.
Additionally, there seem to be certain layers where if I try to move objects to the layer with the script, I get an error with each object that says “Error: Cannot move locked items to a new layer,” even though none of the objects I’m trying to move are locked. However, then it goes ahead and moves the object to the layer anyway. (Here it seems like writing a line into the script to suppress error messages could be useful.)
I’m sorry I’m not able to post a sample file online, but the policies of the company I work for wouldn’t permit that. This seems like it will be a very useful script once it’s debugged. I wish I had the programming skills to help more!
Aaron Gray
ParticipantThanks, Oleh. I will keep testing it out—in other documents as I have the opportunity. I did try saving it as an IDML but that didn’t resolve it. Thanks again for the help!
Aaron
Aaron Gray
ParticipantThanks, Oleh! I renamed the “Index” layer (to just “Layer 2”), and I even renamed the object style for good measure to not have “index” in the name of it, and now I’m no longer getting the JavaScript error.
However, I’m still getting inconsistent results. Whenever I run the script, some frames successfully move to new layers and some don’t, and it’s not always the same ones. I can’t figure out what the pattern is! They are all definitely text frames with the same object style applied to them. One thing I do notice is that it seems to work more consistently when I’m moving objects up in the layer stacking order as opposed to down. When I move them up, they all seem to go up, but when I move them down, some get left behind.
Aaron Gray
ParticipantOleh, I see now that your email is in the script. I will send you a file. To answer your other question, they are all text frames that have the object style applied.
Aaron Gray
ParticipantHi Kai. I tried what you suggested and it did still return the same error, but I will wait and see if Oleh has any ideas. Thanks!
Aaron Gray
ParticipantThank, Kai. Where/how would I insert that into the code?
Oleh, is there an email address or other location I could send you a file?
Thanks!
Aaron Gray
ParticipantThanks, Kai. I have an 11-page document with four layers in it: “DataFrame,” “Index,” “Layer 1,” and “Feature Boxes.” I have 10 different object styles in this document including one called “BB18 Index Frame.” I would like to move all the text frames in the document that have the “BB18 Index Frame” onto the “Index” layer, but when I try to do that with the script I get the JavaScript error. I’m also noticing that if I try to move all those objects to other layers, I get inconsistent results—some move and some don’t. I check to make sure that they all really do have the object style and they do, and there are no style overrides. Also, the layers are all unlocked.
Aaron Gray
ParticipantOleh, this script is a great idea and just what I was looking for. However, I’m having some trouble with it. It works great sometimes, but other times I get a JavaScript Error:
Error Number: 30477
Error String: Invalid value for parameter ‘to’ of method ‘move’. Expected Array of 2 Units, Spread, Page or Layer, but received nothing.
Line: 37
Source: app.activeDocument.textFrames[i].move(app.activeDocument.layers.item(layer));Do you have any idea what could be causing that? I’m using InDesign CC 2014.
Thanks!
Aaron GrayMay 2, 2018 at 5:58 am in reply to: Using GREP to select paragraphs that don't contain something #103484Aaron Gray
ParticipantThank you, Viktor, Michael, and Robert, for the comments and suggestions. Viktor, that string did the trick. Thank you so much!
Aaron
Aaron Gray
ParticipantNo problem!
Aaron Gray
ParticipantHi Holly. Check out the following blog post, and that will walk you through it. Good luck! https://creativepro.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php
Aaron Gray
ParticipantYes! That’s exactly what I needed, Kai. Thank you so much!
October 25, 2016 at 9:33 am in reply to: Mapping MS Word styles to InDesign styles in style groups #89314Aaron Gray
ParticipantKai, I was able to use the script at that link as a jumping off point to create my own script that is accomplishing what I need it to. Thank you so much for the help!
Aaron
-
AuthorPosts
