
Copy link to clipboard
Copied
I wanted to ask if by chance any of the scripting gurus here happen to have written an AI script that will take a number of selected sublayers/sub-sublayers and move them so they become top-level layers?
I am really needing this very badly, given that After Effects can only handle AI layers as separate entities. So I find myself moving tens, even hundreds of nested sublayers to the top level all the time.
Is it possible this script exists already?
1 Correct answer
Install the script.
Launch Illustrator.
Open the AI file.
Note that an expanded Blend is on the Artboard. Each object from the former Blend is on its own Layer. The Layers palette contains 100 or so Layers, all named sequentially and nested 10 levels deep.
Run the script a few times. Each time the script runs, an alert tells you the number of existing top-level Layers. It then moves any sublayers nested inside each of those top-leve...
Explore related tutorials & articles
Copy link to clipboard
Copied
Hi Carlos/Anyone who can help!
Is there any chance you could help me? I'm quite new to illustrator and I can't get the script to work. I'm trying to import a project into after effects but I've got alot of items that I've named and have now released to layers - but I keep getting this error when I run the script:
It looks like the similar problem to the person earlier in the thread that was using the text only script, but this is the updated script for all objects: this is the script I have in textedit:
Thanks!!!!
Mark
Copy link to clipboard
Copied
UPDATE! - I've somehow managed to just randomly delete lines in the code until it worked. For anyone who needs it, the code that worked for me is:
// http://forums.adobe.com/thread/877442? | |
// http://forums.adobe.com/thread/1408454?tstart=0 | |
// carlos canto // 09/26/14 | |
// https://forums.adobe.com/thread/287812 | |
var idoc = app.activeDocument; | |
var ilayer = idoc.activeLayer; | |
for (i=0; i<ilayer.layers.length; i++) { | |
var sublayer = ilayer.layers; | |
sublayer.name = sublayer.pageItems[0].name; | |
} |
Here is the .jsx file incase anyone has the same issue I had:
https://www.dropbox.com/s/7nc46odgusx3nv9/Renaming%20Script%20for%20Illustrator.jsx?dl=0
Copy link to clipboard
Copied
Hello,
I need an illustrator script that can find layers and sublayers by name,
and select just those isolated layers all at once,
so that I can hide or delete or modify them all at once.
For example, the sublayers I need to find are all called "circle".
Copy link to clipboard
Copied
Bonjour Jennifer,
Drole de méthode, un calque par tracé, pourquois ne pas utiliser un groupe par reère qui contieidrai à la fois le cercle, le texte et le trait (nommer les cercles "circle")?
Ce n'est pas mon prblème quant à la question:
On ne peut pas sélectionner un calque par script (en ma connaissance)
donc voià ma solution, pour plus de détails, me consulter par mail.
Suivant la valeur des variables de la zone INIT de script (visible ou remove) le calque "circle".
// JavaScript Document for Illustrator
// INIT ----------
var layername = "circle";
var Visible = false;
var remove = false;
//----------------
var docRef=activeDocument;
var pathitems = docRef.pathItems;
for (var i = pathitems.length-1 ; i >= 0 ; i--) {
item = pathitems[i];
if (item.layer.name == layername) {
if (!Visible) {item.layer.visible = false;}
if (remove) item.layer.remove();
}
}
René
Copy link to clipboard
Copied
found a non-script answer:
https://www.youtube.com/watch?v=AAESBjlo1-o
Select toplevel layer. select release to layers. Shift drag sublayers out the top layer.
(from 'learning illustrator')
Copy link to clipboard
Copied
Bonjour à tous!
Félicitation JET pour ce script qui est très réfléchi, dans la mesure où les calques se retrouvent tous dans le bon ordre, (1 à 102).
Je n'utiliserez certainement pas ce script mais merci pour ce qu'il m'a apporté, j'ai enfin un peu compris l'utilisation de ElementPlacement.PLACEAFTER.
je ne voyait pas comment l'utiliser. (si vous avez d'autres exemples d'application et aussi avec PLACEBEFORE?).
Si on m'avait demandé de faire ce script, j'aurais utilisé move(currLayer.parent...
mais l'ordre n'est pas toujours bien respecté.
René
PS Je me suis permis de modifier le script pour tout traiter en seule une exécution. testé sur CS6)

