Illustrator Scripting :: CS5 - Clean Way To Unlock Endless Sublayers?
Apr 28, 2012
I've written a snippet that will unlock sub of sub layers up to 10 layers deep. It works fine; however I'm wondering if there is a better way to do this? I don't know that 10 is the maximum of sub layers I'll need to unlock but it's a fairly safe guess. I'd like to be more efficient and know that no matter what the layer structure of the file my script has unlocked any and all sublayers.
Is there a different approach or way to think about this problem where you can script for a potentially endless number of sublayers, and subs of subs, etc.?
var doc = app.activeDocument;
var layerCount = doc.layers.length;
for (i=0; i<layerCount; i++) {
var currentLayerI = doc.layers[i];
var layerCountII = currentLayerI.layers.length;
for (ii=0; ii<layerCountII; ii++) {
[Code] .....
View 4 Replies
ADVERTISEMENT
Apr 26, 2012
is there a way that I can loop through all layers and sublayers looking for a name of a layer? I have one that loops through only top level layers. I am thinking I have to somehow incorperate all pathItems, groupItems and the like to incorperate all types of "layers" there might be, since a group is technically not a layer but a groupItem.
this is what I am doing so far:
for (var i = 0; i < numberOfLayers; i++) {
var customName = "div structure";
var myLayer = app.activeDocument.layers[i];
[Code]....
View 6 Replies
View Related
Jun 5, 2008
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?
View 16 Replies
View Related
Feb 17, 2013
I have 3 similar but different documents. I made the edits to one of those and now I need to bring that over to the other 2 files. I know I can copy and paste the areas I need to the other 2 files but when you do that, everything merges into a single layer. How do I do this and keep those items in their own sublayers as well?
View 5 Replies
View Related
Feb 27, 2012
Does this script also cleans up unpainted objects and empty text frames? Personally, I don't think so because the check of the script in extendscript and illustrator results negative.
var idoc = app.activeDocument;var straypoints = []; for (i=0; i<idoc.pathItems.length; i++) {
var ipath = idoc.pathItems[i]; if (ipath.pathPoints.length==1)
straypoints.push(ipath);} for (j=0; j<idoc.textFrames.length; j++) {
var itext = idoc.textFrames[j]; if (itext.textRange.length==0)
straypoints.push(itext);} for (k=0; k<straypoints.length; k++)
straypoints[k].remove();
I also want to automatically remove all objects who have a white fill (white background) and no stroke.
Problem is a created pdf-file of an html-file of a table that must be cleaned up. There are a lot of stray points, empty text frames, unpainted objects, white "cells" that are also be painted in the pdf.
View 1 Replies
View Related
Aug 12, 2013
Is there a possibility to count (only) all sublayers in a given layer? CountLayers from LayerSuite is only counting top-level layers and that isn't good enough.
Edit: I am using CS SDK 5.
View 2 Replies
View Related
May 7, 2012
I just installed cs6, and when I open files in Illustrator, it opens all of the layers which contain sublayers. It does this even if all the top-level layers were closed during the previous save. The files I work with have a large layer-structure, so re-closing the top-level layers every time I open a file wastes a lot of my time. Can I close all layers at once, or better yet, can I stop Illustrator from opening all of the layers automatically when I load a file?
If not, then WHY on earth not? I can't be the only one who opens and closes large files with lots of layers and sub-layers...
Edit: I also am noticing this problem is even worse in cs6, because openning and closing individual layers plays a little animation of rotating the triangular arrow before the layer which, cute as it may be, just makes the task of individually closing up all my layers that much more tedious. Can I turn off that little animation of the triangular arrow when opening and closing layers?
View 8 Replies
View Related
Jul 3, 2012
We all hide and unhide things constantly as we work.But when you do a Show All (CTRL+ALT+3), to effectively unhide all hidden objects, is there a way to do so without unhiding all hidden sublayers as well.
When I do a Show All, even sublayers that were hidden when the file was opened (and never unhidden) unhide along with all hidden objects.
View 2 Replies
View Related
Apr 11, 2013
I opened a PDF in Illustrator and it has 4 Spot color swatches. Two of them will not delete or let me alter them and I need to change them to CMYK. I've tried reopening the document, restarting my computer and copying and pasting everything into a new document. Nothing has worked for me. I've also tried selecting everything, and going to Edit > Edit Colors > Convert to CMYK ... and then making a new color group (with global checked.) Still won't let me edit the two problem swatches. I then went to "Select all unused" from the swatch panel (thinking they would at least get selected because all of the colors should link to my new global color group) and the two problem swatches did NOT get selected. I've tried deleting all the links (thinking maybe the spot color was tucked in an eps file or something.) No objects are locked and none of the layers are locked.
View 6 Replies
View Related
Dec 18, 2012
I'm try to automate the importing of the Varaible and datasets into my graphs via Scripting, but the ImportVaraibles() function doesn't seem to work. Here is my Script, mostly copied from the example script provided with Illustrator (CS5). And, this works manually, using the file names in the script, via Load Variable Library
Set appRef = CreateObject(strIllistratorVersion)
'Open the file and import the datasets
Set docRef = appRef.Open(strTemplate & "200-500.ai")
'docRef.Datasets.RemoveAll
docRef.Variables("Yearbook").Delete
Here is the problem, after I delete the previous library, then this next line, right from the example, does nothing
The script then exits with 'No Datasets in this document'
docRef.ImportVariables (strXMLFolder & "Lumber_200-500.xml")
'appRef.DoJavaScript "alert('Template:" & strTemplate & strRange & ".ai | XML file:" & strXMLFolder & "" & objFile.Name & "^')"
If (appRef.Documents.Count > 0) Then
Set docRef = appRef.Documents(1)
[Code]....
If I remove that delete line, the script runs, but just uses whatever Variables I had last loaded, not the XML file.
It's simply not loading. What do I need to do to get it to load?
View 8 Replies
View Related
May 6, 2012
Can you access graph data through the scripting DOM?
View 3 Replies
View Related
May 12, 2013
I am running a script that batch places the name of the document in the image and then saves the document, for all documents in a foder.However, it refuses to place this text, as the target layer is initially locked. So I am looking for a piece of script that I can add to this script which will first unlock all the layers in the document.
View 3 Replies
View Related
Aug 10, 2009
I am working in Illustrator CS4 and I am currently having a problem resizing text boxes to either enlarge them to add more type or reduce them to eliminate unused space within the active box. When I place the cursor on the corner of an active box, I get a square symbol instead of an arrow which would indicate that I can change size. All I can do with the cursor now is move the position of an active box.
View 6 Replies
View Related
Dec 12, 2013
I am using Illustrator CS6 and if I click on one of the file menus ("File", "Edit", "View", etc.) if I want to open another menu without closing the previous one I have to click on it, while the default behaviour for other applications is for the menues to follow the mouse cursor, so how do I make it so that if I open the "File" menu and mouse over the "Edit" menu, the "Edit" menu would become open?
View 7 Replies
View Related
Mar 28, 2012
Win 7, LR4
I have a Western Digital desktop 1 TB backup, using the WD Anywhere Backup software. I have had zero issues using this over the last three years with previous LR versions, Win Vista, and now Win 7. This issue started with the LR 4 beta, and continues with LR 4. No other issues with any other program.
I back up my LR catalog daily when exiting LR. The backup process would go into an endless loop, cycling through optimize, integrity, and backup routines. It would get almost to the end, and start over. After several cycles, LR would stop responding and quit. I would also get a popup from the Anywhere Backup software, telling me there was an error in the backup process. Another popup would tell me it had quit and offer to submit the info to WD, which I did on several occasions. I finally figured out I could complete the backup process if I paused the WD backup process, but I started getting other error messages related to WD. I have now got it down to actually quitting the WD program before opening LR, and once I have closed LR, restarting the WD program and all is well.
View 8 Replies
View Related
Mar 30, 2013
Any solution to the endless pinwheel in 11 Editor (updates installed)? I load a previously created PSD file, move a few layers around and the endless pinwheel appears. Have to Force Quit.
MAC OSX 10.8.3
View 1 Replies
View Related
Mar 5, 2014
My Adobe 4 and now Adoe 12 Photoshop has the picture catalog thumbnails with a ? mark in the corners. Any operation results in an endless file search.
View 4 Replies
View Related
Feb 10, 2011
When I select MANY objects on screen with the selection floater open, the selection floater scrolls through endledss combinations of white and blue jumping up and down the list. This can take ten or fifteen minutes!!! How can I get this to act properly (other than the obvious close the selection floater before making any selections).
View 1 Replies
View Related
Oct 1, 2012
Any way to convert this image to a vector without having to recreate the entire thing. I need to make it so that it can be used like the rest of the logos on this sponsor backI have tried so many different ways but it's just not coming out right. The client doesn't have access to a better copy of the image, and I need to get this to the printer tomorrow.
View 3 Replies
View Related
Apr 18, 2013
I am having trouble when tracing a sketch to convert it to vector. I have tried scanning it into photoshop first then exporting it to illustrator, and also just scanning in as a jpeg and opening it in illustrator.
The trouble I am experiencing is that the lines are not clean, but appearing very grainy. When i choose Fills I get the best result, but with Strokes i get 2 thin lines and obviouly no fill.
Either way I can make the color of the lines all the same, but am unable to create objects within the lines to fill with color, such as face, sunglasses, etc. I can do it with live paint but I know there are other ways to color in files in AI.
Here are the original, the fill, and the stroke result outcomes
Here are the files on dropbox [URL] .....
View 5 Replies
View Related
Aug 18, 2013
Im a newbie and a few month ago i made my first skin for a race game with GIMP. Now i want to create another skin.
I follow this proceure as i did a few month ago:
- open the PSD template called A.psd- change the base colour
- export the A.psd to A1.psd.
- As soon as i open the A1.psd in GIMP i lost my sub layers.
I did this before and it worked fine. Although i cant recollect which version of Gimp i used. Has this been changed is the latest version?
View 1 Replies
View Related
Mar 16, 2013
the Script of creating mirror text and stroke text in Adobe illustrator scripting.
View 4 Replies
View Related
Feb 15, 2014
I have the colored logo in vector but I need a crisp clean vector black and white outline.
View 4 Replies
View Related
Dec 4, 2012
Cannot lock other paths/unlock all paths in symbols?
View 8 Replies
View Related
Jan 15, 2014
Quite new to Ai's scripting stuff.
I'm having a complicate time with Ai's save to jpg options vs artboard sizes and units conversions.
Say, i have a doc (from my client), which they inherited and enhanced for 10 years may be.
It's "supposed" to be in millimeters, but artboardRect gives me those values :
-0.27880000000005
436.191388980878
646.457
-0.20900000000074
which sound like weird points or pixels.
I need to export a jpg (or gif, or png), that will be X pixels wide. For the purpose of the test i set it at 1200.
var maxLargeurPx = 1200;
First thing, getting the artboard's width :
largeurArtboard = Math.abs(thisArtboardRect[2]-thisArtboardRect[0]);
// 646.7358
Then i try to have a multiply factor to use
coefExport = /*Math.round*/ (100 * maxLargeurPx / largeurArtboard);
// 185.54717397738
and then set my ExportFile jpg to this value (i can't give it a number)
// exportOptions.horizontalScale = coefExport
That's when it's getting fun : my images are 1204 px wide with or without clipping.
Of course, i "can't" resize the doc for each export, especially expecting to have dozens of those, with different values, dimensions, etc.
View 5 Replies
View Related
Jul 27, 2012
I wrote the following AppleScript to open a PDF file and export is as PNG. I am using Illustrator CS5.
The export command gets an error: Adobe Illustrator got an error: Can't get current document.
when it encounters the export command.
set inputFile to (choose file with prompt "Open PDF file to convert to PNG:") as text
set exportFile to inputFile & ".png"
tell application "Adobe Illustrator"
if not frontmost then activate
open inputFile as alias without dialogs
export current document to exportFile as PNG24 ¬
with options {class:PNG24 export options ¬
, resolution:300 ¬
, matte color:{red:0, green:0, blue:0}}
close current document saving no
end tell
View 5 Replies
View Related
Jun 20, 2012
Im trying to add a pdf on top of an existing PDF in illustrator using a script. This is supposed to be done by anyone at my firm so that is why I want it in a script. I also have a lot of other functions that works that will do some other stuff with this document.
Created this from the scripting guide but it doesnt work. Im pretty sure its the embedDoc var thats empty and i dont understand why. Im not sure if the File "points" to the directory of the script or the original file but Ive tried both ofcoarse.
This is the masterpiece
var embedDoc = new File("/temp/testfile1.pdf");
if ( app.documents.length > 0 && embedDoc.exists ) {
var doc = app.activeDocument;
var placed = doc.groupItems.createFromFile( embedDoc );
}else {alert("suck")}
View 4 Replies
View Related
Apr 7, 2012
Is it possible to reference layers or groups by their names instead of their index using VBA? If so, what is the sytax? I know you can do it in Extendscript, but I'm not finding info for VBA.
View 7 Replies
View Related
Oct 10, 2012
Swatches Swatches Read-only. The swatches in this document.
Deletes a swatch from the current document
Set appRef = CreateObject("Illustrator.Application")
Set documentSwatches = appRef.ActiveDocument.Swatches
Set swatchToDelete = documentSwatches(5)
swatchToDelete.delete
How am I supposed to be able to make changes to the swatches collection - it is read only...
Not supprisingly I have failed to implement this in C-sharp
View 5 Replies
View Related
Mar 13, 2014
I am trying to close alert at once but the loop continues the alert, how can I stop the alert at once
var doc = app.activeDocument
var layersToTargetNameArray = ["Background", "Artwork", "diecut", "size", "sign off panel"];
for (var i = 0, il = doc.layers.length; i < il; i++) {
var curLayer = doc.layers[i];
[Code] ......
View 6 Replies
View Related
Feb 11, 2014
Is there anyway in JavaScript to replace one swatch with another?
I've seen other posts where similar questions have been asked, but the solution seems to involve iterating over all the pageItems, testing and then changing the fillColor.
All I want to do is delete/replace a specific color. Say replace Yellow with Green.
Is there a way of doing this without recursing through all of the page items?
View 3 Replies
View Related