Illustrator Scripting :: Convert Layers In Document To Artboards?
Sep 24, 2013
Script which would convert the layers in a document to artboards? At present I have a lot of documents with a couple of hundred layers on each of them, but I've decided to change the way that I organise my workflow and started using artboards instead. I don't really have the time to spend moving them individually from a layer over on to an artboard as there are a lot.
I am writting in extended javascript to convert .ai document into HTML/CSS. for Placed image item i want to wirte css data. but the url of image path i am getting from the placedItem is : '~/Desktop/AdobeIllustrator/home.jpg' when the same path i am using in my css like :
Is it possible to script the menu item Object/Path/Outline Stroke?I need to cycle through all the Path items in the document and convert them to Outlines.
I can't figure out the proper commands to fill out and complete the script below. What I am trying to do is:
- Create a new document using one of the Profile presets (or have the New Document dialogue open so I could select the profile, size and bleed) - Make 3 layers, each with a diferent name - Create a rectangle the size of the artboard on the bottom layer, with a swatch stroke and no fill - Create a rectangle the size of the bleed on the middle layer, with no stroke or fill
Like I said, I haven't gotten far at all. I've read through the basic scripting guides and I'm just not understanding all of the language needed to string things together.
tell application "Adobe Illustrator" make new document set topLayer to make new layer ¬ at beginning of document 1 with properties {name:"Vector"} set bottomLayer to make new layer ¬ at end of document 1 with properties {name:"Through Cut"} end tell
Is it possible to loop thru the artboards (with Illustrator CS5) and only work with the pageItems on the current iterated artboard?
For example, if I have 3 artboards, with 2 textFrames on each artboard. And I add the textFrames sporadically (I add a TextFrame with contents "Text 1" on artboard 1, then a textFrame with contents "Text 2" on artboard 3, then a textFrame with contents "Text 3" on artboard 1, etc).
Artboard 1: Text 1 Text 3
Artboard 2: Text 4 Text 6
Artboard 3: Text 5 Text 2
Is there a way to loop thru these artboards and get the textFrames tied to the appropariate artboard? So, on the first iteration of the loop, I'm looking at artboard 1 and only looking at "Text 1" and "Text 3", then on the the 2nd iteration I'd be working with artboard 2 and it's textFrames "Text 4" and "Text 6", and so on.
If I loop thru only the doc.textFrames, the order would be incorrect, with the way I added each textFrame. Instead of artboard order, they'd be in this order:
I'm trying to create some simple vertical centerlines to be drawn in the same spot on all existing artboards in my document. What I have so far is creating the proper amount of centerlines but only drawing them in the correct spot on half of the artboards while the other half are being drawn in the space between the artboards. Here's what I have so far.
function addCenterLines() { var doc = app.activeDocument; for (var i = 0; i < doc.artboards.length; i++) { var abRect = doc.artboards[i].artboardRect; [code]...
showing the top of a couple of the artboards and the misplaced centerlines in between.I think I have a great misunderstanding of how the abRect coordinates work, as in which side is [0],[1],[2] and [3], which may be leading to my inability to get this right. How I can sort out my centerlines. The centerlines provided in the print dialog are not an option in this case.
I'm building a script that loops through folders and prints all available PDF-files (long story). I'm having some issues with PDF-files, that has multiple artboards in them.
When doing the obligatory "sourceDoc.Print()" it only prints the first artboard. Are there any available print-options that I can set to force it to print ALL artboards in the given file?
Is there a way to add new art boards to an existing document (same dimensions and same space betwen artboards)? What I do now is I have to create a new file (with new number of artboards) and cut & paste - is there another way to do this?
I have a few hundred vector files each of various sizes. I want them resize the vector shapes to the scale fit to 300"x200" artboard.I want them all to appear centered on a 300"x200" artboard.
I'm looking to create a script to batch rename a number of artboards.
- I have 100 named layers.
- I have 100 artboards.
- I would like to rename the artboards to match the layer names.
- The layers are organized in the same descending orderas the artboards (ignoring the actual artboard names*).
- The topmost artboard (1 in the list) would be renamed "newspaper", the second artboard would be renamed "typewriter", the third artboard would be renamed "books", etc.
*in the example below the artboard named "Artboard 7" is actually the 6th artboard in list.
I have 30 separate illustrator pdf files (one page each) that I would like to make into one Illustrator CS6 file with 30 artboards. Is there any way to do that without having to import one by one?
I'm trying to do some workflow enhancements. For our games we need to export to PNG at different resolutions for different mobile devices. I use a artboard per asset and currently manually export 3 times (using file/export/png with use artboards option), at 72 dpi, 144 dpi and 33.75 dpi.
I've been modifying a simple Javascript I downlaoded and have got it save to different fixed locations at different scales. All good. However exporting every artboard each time will cause issues with our version control system and take too long. It's not really a solution.
So I need a way to either only export the current selected artboards (which I believe can't be done) or somewho show the artboard range dialog that the system uses. Either of those would be a good solution.
var docRef = app.activeDocument; var num_artboards = docRef.artboards.length; var getName = app.activeDocument.name; var fileName = getName.slice(0, -3); [code]...
I must have pressed some shortcut and now the document background between artboards is no more dark gray (as usual) but fully transparent. How to restore this?
Am I to understand if I have multiple artboards, they all will share the same layers? Each artboard does not have it's own separate set of layers, am I right? This is my first time using the artboard feature... CS6.
Sometimes, after moving stuff around (groups, layers or artboards), I notice that hidden objects didn't move with everything else.
How this can be if no objects are locked ?I cannot make this happen on purpose with a simple example and it is really annoying not to be sure that everything was moved properly.
I´m aware that Illustrator doesn´t have multiple artboards options for JPG as it does with eps, or other formats, but is there any workaround for this? Looping current artboard and exporting them to JPG or something. Or maybe there is someway to force the "save multiple artboards:true" in JPG?
export document currentDoc to file exportFolder as JPEG with options ¬ {class:JPEG export options ¬ , quality:100 ¬ , artboard clipping:true ¬ , artboard range:1 - 2 ¬ , save multiple artboards:true}
While working and when the job was nearly done (Photoshop document with several layers to correct wrinkles, teeth, neck...) , I found out that the document is setup RGB.I have to convert it into CMYK but I don't want to merge it or lose layers since I need them in another Photoshop document too.
While converting the image from RGB to CMYK, I found out that some of the layers (hue/saturation adjustment layers) don't exist anymore when converted to CMYK...How do I get these layers (or at least the effect they give to the design) in CMYK?
I'd like to export certain properties from an ai-document to XML. The XML will be post-processed using XSLT. Secretly, I'm hoping that I can invoke the Reflection-system (as mentioned brifely, I might add) in the ExtendedScript Toolkit CS6 Core JavaScript Classes.
How to get reflection working for JavaScript objects (both built-in and the ones I've created in code my self)? Are there any guides that are relevant in my case? (Try googling "illustrator script reflection" and you get a bunch of flip object scripts ...)
Is there a way to write a script to copy a selected/chosen artboard (and it's contents) to another opened document, placing it in exactly the same place on the global x/y coordinates? I'm either unable to find this feature built in to Illustrator, or it's simply missing.
As I understand it, TextFonts is a collection of all fonts available to Illustraot. Is there a collection of all fonts used in the open document? Or would I have to step through every textFrame an create that list myself?
It does almost what I need it to do. except that it also copies the ".ai" in to the layer name. Is there some way to modify this script to have it exclude or delete the file extension?