Illustrator Scripting :: Assign Default Colors To New Layer?
Aug 7, 2013Is there a way to assign one of the default layer colors with javascript? like light blue, light red, or green.
View 3 RepliesIs there a way to assign one of the default layer colors with javascript? like light blue, light red, or green.
View 3 RepliesFor example I would like to make my images layer Green and my copy layer Red in my layers palette.
View 6 Replies View RelatedIn the extend script documentation it says you can assign a name to UI elements at creation like the example given below
dlg.btnPnl.cancelBtn = dlg.btnPnl.add('button', undefined, 'Cancel',
{name:'cancel'});
but when i do it like that, the bject's name comes out as undefined when accessed like this
dlg.btnPnl.cancelBtn.name
or like this:
dlg.btnPnl.children['name']
but adding the object then naming like this works-
dlg.btnPnl.cancelBtn.name = "Cancel";
I'm using illustrator cc and the extendscript guide for cs6 (couldn't find a newer one). Did the syntax change?
Is there any chance to assign values to an artboard?
I've experimented with “tags”, but they only work for pageItems. (if the item which includes the stored data is deleted, the data is also deleted)
It is simple data like v1=true, v2=false, … I want to assign. And it needs to be saved within the illustrator document.
Under the edit tab I can click on the link option and change the colors together at the same time, though this does not work when on the Assign tab.
1. Is there a way to get it to change the colors of different shapes at the same time in the Assign tab?
2. The blue circle in the color wheel is clearly changing the hue of the blue, though with the other two arms, the circle with the black ring around it, when I drag it to darker hues it changes both the star and the polygon while the other circle only changes hues sometimes if I drag it somewhere completely different. How does this process work?.
I'm trying to write a script that renames a layer, and group within the layer, then an object within the layer (but not a part of the group) and have it run in a loop.
Here's what I've got so far, the group rename doesn't work.
#target Illustrator
var doc = app.activeDocument;
idLayers(doc)//IRename layers
idGroups(doc)//Rename groups
function idLayers(doc){
[code]....
I haven't put in anthing to rename the single object yet since I cant even get the group rename to work. I suspect that the group re-name section isn't working because I'm either using bad syntax or an invalid command.
I'm trying to change the colors of a pathItem corresponding to the string value of several text fields in my document. I've been successful in changing the fill and stroke color of the pathItem, but I can not find any reference in the Illustrator Javascript Guide for accessing additional strokes and/or fills that have been applied to the object in the Appearance panel.
View 1 Replies View RelatedI am trying to create a script that adds custom spot colours to the swatch pallet. I've manage to put together something that works (I've adapted an existing script), but the colours added are not spots, just CMYK colour swatches.Also, I need the script not to error if the swatch already exists.
//Add Custom Swatches
var docRef = app.activeDocument;
function cmykColor(c, m, y, k) {
var newCMYK = new CMYKColor();
newCMYK.cyan = c;
newCMYK.magenta = m;
newCMYK.yellow = y;
newCMYK.black = k;
return newCMYK;
[code]....
I have about 300+ product labels that are in Illustrator, and some of them have an incorrect rich black color swatch. What I have been doing is going through and changing the color pallette to change them manually. Essentially going to the instance of black and changing them to regular black.
Is there any sort of script that can do this? The files are in CMYK.
Otherwise I have a lot of monotonous file editing to do.
I tried to add a LabColor with an Illustrator script.
function addLabColorToSwatch(L,a,b,swatchName){
var color = new LabColor();
color.l = L;
color.a = a;
color.b = b;
var swatchgroup = app.activeDocument.swatchGroups.add();
swatchgroup.name = "test swatchgroup from jsx script";
[code]....
The script crashes on the Line 'swatch.color = color;' with "Error 1202: Not implemented"..This seems to a bug. I allready filed it.
I need to generate an overview of the colors used in a document.
For that, I would like to cycle through several rectangles of which I know the exact size. The rectangles are filled with a color from the swatch palette.
What I try to achieve is that the swatch name of the rectangle's fill color is written to a text field directly above the rectangle. But I could not find a possibility to 'extract' the fillcolor from a pageItem into a pastable string.
Is there a way to do this with Illustrator and Javascript?
color value of spot colors cannot be adjusted via javascript?
View 5 Replies View RelatedI've been looking around for a script that will take the used spot colors in a document and place them in a predetermined spot. I've came across several posts about this, such as the COLOR CHIPPER although I think it's focus was on swatches. What is confusing is the part of making New CMYKColor or RGB or if I even need to do that. I've looked at other posts and the Adobe docs, but none seem to work. Adding the text isn't difficult, it's getting these spot colors to reflect what's in the document that is. From what I'm seeing now:
I may have to use some other type of script such as Applescript to get rid of unused swatches first throught the actions panel, but I'm not sure.I could possibly use the getByName method to call out the specific rectangle and the and relative callout with the appropriate color instead of having to position everytime.
I need to automatically create all the possible pattern combinations with 6 shapes and 6 colors.
I have an Excell file with assigned color combinations (values from 1 to 6) in the rows, and the shape name (A to F) in the columns. Column 7 is a string containin the color combination names (i.d. 123456, 123345 etc...) so that I can output each combination with the color/numbers in the name.
I'd like Illustrator to pick every row and assign the contained colors to each shape of the column and to export a .png with the name from column 7 content.
Just simple as that! But to me it sounds pretty hard!
Is there a script that makes it already posted somewhere? - i couldn't find any - or something simliar to start coding from?
Any way to allow a user to choose a folder from a default location. I thought I had found the solution but it's not quite working as I wanted:
#target illustrator
//Example 1
var output_folder = Folder.selectDialog ('Choose PDF output folder.');
//Example 2
var myFolder=Folder(app.activeDocument.path).selectDlg("Choose PDF output folder:");
If I use the code in example 1 the choose folder dialog appears and the 'Open' button is available and when I press the button the location is chosen as expected. However if I use the code in example 2, although the choose window opens in the path of the active documents location the 'Open' button is not able to be pressed until I select a folder., which means that the chosen location is not correct. I should indicate that I'm running this code on a Mac.
Any way to have a choose folder dialog window specify a location and be able to select that.
I'm using a mac running illustrator cs5 and have about 4 thousand eps files (all vector paths filled with black) that need to be assigned colors randomly from a defined color palette (25 custom swatches). The first 2 swatches should be omitted- they aren't relevant to this task.
The script should open the file select all vector elements and assign a random color form the defined custom swatch palette then save the file and move on to the next.
I am using a MAC OS version 10.6.8 and ESTK 3.6. When I open ESTK the font is very small and I want to make it larger. I go to ExtendScript ToolKit>Preferences when I click Fonts and Colors the program crashes and sends an error report to Apple.
I would like to script Illustrator with .jsx instead of AppleScript because I am more familiar with JavaScript (plus it's cross platform compatible).
I want to open a "Save File Dialog " with some default path.Like when user run that script I want to open a "Save As" dialog box with default path "/Volumes/<shared name>/<folder name>/.. ."I am using File.SaveDialog(prompt, filter);
but it doesn't open to the location by default that I want to open.
I have several Illustrator JavaScripts that I've written with the ESTK. A lot of these scripts involve resizing the artboard or artwork to specific sizes. Instead of forcing the user to manually input the dimensions they want into text fields, I just stored a half-dozen or so "presets" in an array.
Then they can select one of the presets from a dropdownlist, or go ahead and input a custom size. These presets are the same for multiple "resize" scripts, so it would be nice to store those presets in a separate file (i.e. presets.jsx) that my resize scripts could reference, so when I need to add or change a preset, I could just go to that one shared file, and all the scripts would be updated.
Is it possible to do that? If it is, a quick example of how to load the variables from another file.
Too many CMYK colors for the Print Profile. How to I make it that only 3 colors show up?
View 1 Replies View RelatedCan you change permanently the default highlight color(s) for layers in new documents? CS6
View 2 Replies View RelatedI prepare graphics mostly for print, so I like to turn on the Proof Colors view and Overprint Preview views. It's a pain to turn these on for each document. Is there a way to make these the default viewing settings in Illustrator CS6?
I tried creating an action to do it, but the Insert Menu Item command in actions causes Illustrator to crash every time, and the help file seems to say that View commands are unavailable to actions. So I'm not sure if that's a bug. Oddly, Photoshop has the very useful File> Scripts> Script Event Manager that let's me turn on Proof Colors (via an action) whenever a document is opened. It works very well. However, Illustrator does not appear to have these options. I found the View> New View options in Illustrator. They let me create a view that turns on Overprint Preview, but absolutely refuse to turn on Proof Colors. So it's the same number of clicks and pointless.
Illustrator CS6, v. 16.0.3 64-bit, Windows 7 Ultimate 64-bit
I am writing my own Illustrator scripts.
How do I write a script to delete layer with ".ARD" name.
I am new to scripting in Illustrator.I am trying to import PSD files into an AI layer.So far this is my solution.
var TRGdoc = app.documents.add(DocumentColorSpace.RGB, "1920", "1080");
var onFile = File( '~/Desktop/jpeger/illDanceREFon_00642.psd' );
var REFon = app.open(onFile);
var LAYon = REFon.layers[0];
var LAYstuffon = LAYon.pageItems[0];
LAYstuffon.selected = true;
app.copy();
TRGdoc.activate();
var TRGlayer = TRGdoc.layers[0];
TRGlayer.selected = true;
app.paste();
It works most of the time but sometimes it hangs up on the paste.
Is it possible to script using a highlighted layer.
I know that selected items can be used for scripting, but I would like to just highlight the layers I want to process but not directly select the items on those layers.
what is the script to delete some letters from layer?For ex. I've "Layer XYZ" and I want "Layer XY".
View 9 Replies View RelatedHow to make a layer visible by using the name of the layer, with javascript?
View 2 Replies View RelatedI am working on a script to standardize layers and I need to move all the pageItems from a layer called "PART_NUMBER" to a layer named "STATIC".
following code at the arrow...
I am using "test" to troubleshoot the move.
standardizeLayerNames() // This function verifies that the Layer names conform to the standard Layer names.
function standardizeLayerNames() {
var myDoc7=app.activeDocument
var myLayerCount7 = myDoc7.layers.length
[Code] ........
I create with VBA an Illustrator sheet with custom size:
'define size
Dim B_cust, H_cust As Integer
Set appRef = CreateObject("Illustrator.Application")
B_cust = CInt(InputBox("B=", "Higth:"))
H_cust = CInt(InputBox("H=", "Width:"))
Set newDocument = appRef.Documents.Add(aiDocumentCMYKColor, B_cust, H_cust)
This works fine
I would have fore each new document the same layer order like
cadsymboltext
Rem ###new Layer###
Set myDoc = appRef.ActiveDocument
Set myLayer = myDoc.Layers.Add()
Set myLayer.Name = "cad"
I'm not able to rename the created layer ?
Furthermore I would erase the default Layer LEVEL 1
I use PsCS3 at home and work. I took some work home today, and SHOCK, I didn't have any of the same fonts I have on my Mac at work. Right now, I'm laboriously changing all my type layers one by one to a suitable replacement font on my PC. There's got to be a better way - more suitable to a lazy sod like me, right?
The perfect solution would be to assign the font I want to use for the default substitution font (which is Myrid Pro). I've searched everywhere, but have come up with nada. Is there a way to change this default font to one of my selection?
I am realtively good with actionscript, so I am trying my hand at this to streamline our image exporting process. I am using CS5 on a PC.
We build our illustrator files to be a combination of different layers. Sometimes just one layer is exported at a time, and sometimes layers are combined to form a more complex image. We use layer names with instructions of what layers should be on and off.
An example of the layer naming might look like this:
03 (01-ON, 02-OFF)
02 (01-OFF)
01
I have been able to figure out how to check if there is a note to turn a layer on, my question is how do I select the layer to turn on the visibility without using the exact name of the layer?
In my example, when layer 3 gets exported, it should have layer "01" visible and layer "02 (01-OFF)" not visible. Since our files are always constructed differently (meaning 02 might not always have a note about 01 being off), I can't use the getByName option because I don't have an exact name to call the layer and turn the visibility on. The layers always start with 01, 02, 03, etc. Is there a way to use getByName and only have it look at the first 2 characters of the layer name?