Illustrator Scripting :: Get Swatch Name For Character?
Feb 28, 2012
I'm needing to loop through each character of a text frame and check the color of each character. Is it possible to get the swatch name of each character? Or can you only get the red, green, blue values?
I've been experimenting with:
app.activeDocument.textFrames[0].characters[3].characterAttributes.fil lColor.typename;
// Returns SpotColor
But I can't figure out how to get the swatch name of the character this way?
View 2 Replies
ADVERTISEMENT
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
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
Jul 20, 2012
I'm writing a script to create a new AI document with a restricted swatchbook. The designer is supposed to use only the swatches/inks provided by this script. So far I was able to delete all current swatches and add a CMYK or RGB spotcolor swatch.
var inkt02 = app.activeDocument.spots.add();
inkt02.name = 'inkt 2';
inkt02.colorType = ColorModel.SPOT;
var kleur02 = new CMYKColor();
kleur02.black = 10;
kleur02.cyan = 80;
kleur02.magenta = 0;
kleur02.yellow = 90;
inkt02.color = kleur02;
var newSpotColor = new SpotColor();
newSpotColor = inkt02;
newSpotColor.tint = 100;
thePallet.addSpot(newSpotColor);
Often we will be dealing with Pantone colors. No need to define these, as they are inside AI already, right? But how to call them from the library? I'm new to ExtendScript.
View 6 Replies
View Related
Aug 4, 2012
I have a list of 300+ colors that I need to make into a swatch library for Illustrator. The data looks like this:
GREEN GRASS,127,187,0
PALE YELLOW,241,235,135
LIGHT YELLOW,238,231,93
DAFFODIL,249,231,21
MOONBEAM,249,223,22
etc.
It's RGB I think. In any case, I am just starting with Illustrator and I know NOTHING about scripting. these colors into a swatch library? I am getting a migraine just thinking about putting them in one by one.
I found something here, but that didn't work for me. I get an error on processing on line 75. [URL] ....
Error 24: app.doScript is not a function, Line 75 _> app.dpScript(speakThis, 1095978087); //AppleScript.
I get as far as choosing the csv file, and then I get the error. I think this outputs as CMYK, but not sure.
View 23 Replies
View Related
Aug 5, 2013
I'm trying to challenge myself here, I want to create a copy of every gradient in the active document and give it an assigned name like "Batman 1" "Batman 2" ect.
I can add new gradients and set their stop colors ect but I can't figure out how to create a perfect copy of the gradient in the swatch library.
I've been looking and the only thing I found that comes close was an older script that's only compatibale with CS. In this they're copying EVERYTHING I just wanna stick to gradients at the moment. Here's the link: [URL]
I looked to this as an example of how to do something like this but since it wont work with CS6 I cant really experiment or tinker to figure out how it works.
View 24 Replies
View Related
Aug 13, 2013
i want to get the swatch color of active document . i use 3 to 4 colors both cmyk and pantone which is in swatches now i want to get their values using script.
View 1 Replies
View Related
Jan 1, 2014
I recently created a script that reads the layer names of an Illustrator file, and uses the name to identify a swatch to use to pattern all elements on that specified layer. The script works well, and is a real time saver for our mapping staff, but it requires duplicate swatches to exist, where the only difference is their colour.
To improve the script I want to duplicate a swatch and modify its' colour before applying it to a specific layer. I think the only way this can be done is via the "placedItems" command. So the code I'm trying to write looks likke this:
for(var s=0; s<slib.length; s++){ // search swatch library
var pat=slib[s].name; // get swatch name
[Code]...
However I'm struggling to find the correct syntax to make this work.
View 2 Replies
View Related
Jan 14, 2013
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.
View 5 Replies
View Related
Feb 24, 2012
I've been looking for scripts online that would create a color swatch legend to list the colors used in my illustrator file. I found this (see below) and tweaked it to place properly on my particular page, but it adds everything in my swatches panel to the legend. Ideally, I'm looking for a piece of script to add that would only add used swatches to the legend, or a script that would only add spot colors to the legend.
var docRef=app.activeDocument;
var SwatchBoxSize=24;
var swatchBoxSize=parseFloat(SwatchBoxSize);
var swatchBoxTop=swatchBoxSize+314;
[Code] ......
View 2 Replies
View Related
Mar 20, 2012
I have a couple thousand AI authored EPS files with a specific swatch name (SpotBlack) that I would like to rename (black) -- is there any method to do this en masse, preferrably outside of Illy using a text editor?
View 7 Replies
View Related
Mar 21, 2012
Is there a way to read the swatch used for fill color of a page item?
I can read the fill color but I can't read if the color is a global swatch.
View 2 Replies
View Related
Dec 31, 2012
I have an AI file containing seamless pattern swatches.I'd like to get each swatch vectors (ie : access the swatch groupItem). It's doable when clicking on the swatch panel and dragging the swatch on the document, or even double clicking the swatch in the swatches panel, I'd like to do it with javascript.
how to access swatch patterns properties.
How to access the swatch properties, like when double clicking on the swatch in the swatches panel, how to "simulate" a drag & drop of the swatch to the document, I'll take it too, though I think it is not the most convenient way to do.
View 7 Replies
View Related
May 19, 2010
I have a large list of custom colors in Excel that has the color name and CMYK breakdown of each color. I'm looking for a way to import this information to create a custom Color Swatch Library. That will have the name of the color and the CMYK breakdown. So that I can easily use in Illustrator and Photoshop. Is there any way or application in doing this with out manually entering the information and creating a new library?
View 7 Replies
View Related
Apr 22, 2013
How can I easily find a character if its attribute is different from others? There might be some easier way than compare it one by one.
View 2 Replies
View Related
Jan 11, 2014
Illustrator Version CS3-CC
Preferred scripting: Visual Basic (VBScript)
In the Adobe Illustrator CS5 Scripting Reference (VBScript), I see the following code for setting character attributes.
iCount = textRef.Characters.Count
i = 1
Dim charRef
Do While (i < (iCount + 1))
dSize = dSize * 1.1
textRef.TextRange.Characters(i).CharacterAttributes.HorizontalScale = dSize
textRef.TextRange.Characters(i).CharacterAttributes.VerticalScale = dSize
i = i + 1
Loop
Is there a way to set character attributes on a range of characters at once?
Iterating through the characters one by one is really slow, especially in higher versions of Illustrator (like CS6).
I want to be able to set character attributes, for example, from the third character to the sixth character of a paragraph textrange.
Basically, I want to do something like itembyrange in InDesign scripting.
View 3 Replies
View Related
Jan 24, 2011
How to divide all textFrames in one-character-per-textFrame?
Example: the textFrame "Letters" will be divided in 7 textFrames: "L", "e", "t", "t", "e", "r", "s".
View 30 Replies
View Related
Oct 1, 2012
I'm trying to write a script that applies a single swatch to a single path item and repeat for every swatch that is currently contained in the swatch library. This script that I have written is only applying the last swatch in the swatch library to every path item on the page. Currently I'm more concered with getting each swatch that is currently in the swatch library to be applied at least once before worrying about applying the same patch to any extra number of patch items compared to the swatches.length.
// Apply every swatch library color to path items on a page
if ( app.documents.length > 0 && app.activeDocument.pathItems.length > 0 ) {
doc = app.activeDocument;
[Code]....
View 11 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
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
Nov 10, 2013
I have downloaded some of Ian symbols which is a zip file and Safety Nut 10° thru 55°. How do I place these files in Illustrators Swatch Libraries. The Safty Nut file has installed itself somewhere?? If I double click on the folder Illustrator starts up an the nuts are there in a window but when I close Illustator and restart Illustratior and look for it in the swatch folders it dose not show up?
View 1 Replies
View Related
Apr 15, 2011
I frequently use Pantone solid coated colors in my work, and have to open that palette anew each time Illustrator has been restarted. I know that in CS4 I could keep that palette available, but I haven't been successful doing the same in CS5. I have saved my workspace, but the Pantone palettes disappear when Illustrator quits.
View 16 Replies
View Related
Jul 3, 2012
I can not delete some of the swatches (PMS colours) from the dock. I've tried to search for any artwork that may contain the colour, but I could not find anything. When I open Swatch Options it only lets me change Color Mode. Swatch name and color type are greyed out no matter what color mode I choose. I've tried to copy and paste the artwork in a new document, restart Illustrator but the problem persist.
I work on Mac OS x 10.6.8..
View 2 Replies
View Related
Jul 19, 2012
How do I redefine a swatch color?
View 4 Replies
View Related
May 10, 2013
swatch that I have created in illustrator. Once the swatch is applied as a fill there is a white line surrounding the original pattern. I have read other blog posts about the issue that state that the lines are just on screen and dissapear when you export as a PDF and when you print. I printed the design today at three different scales (100%, 40%, 20%) and all showed a white line but only on the horizontal axis. Both horizontal and vertical lines are visible when exported as a PDF. The original design is vector.
Here is a screen shot of the design from my computer:
Here is a photo of what the design looked printed (notice that the white lines are ony visible on the vertical axis):
View 5 Replies
View Related
Mar 21, 2013
Using CS6 on a MacBookPro
I'm creating a swatch group in my swatches panel and I can click and drag any color in the swatches panel to my new folder. But it won't let me click and drag the custom gradients into this folder. How do I add my new gradient swatches to the swatch group folder in the swatches panel?
View 5 Replies
View Related
Aug 5, 2013
I wanted to save a pattern swatch and not the whole swatch library so I deleted all the swatches until it was just the one pattern swatch. I saved it as an .ase and then opened it in another document. I noticed however that when I open the pattern in the other document it shows the default swatch library and no pattern swatch. When I save the swatch as an ai. it opens the default library as well as the pattern swatch. Is there a way to save just the pattern swatch?
View 1 Replies
View Related
Dec 18, 2013
When I go to "swatch options" and choose at "color mode" RGB mode, which RGB mode is it? sRGB, AdobeRGB,...
View 4 Replies
View Related
Aug 30, 2013
We just got illustrator cs6 in our office. I was given a book and told to learn it, but WOW, it is not easy.
I feel like an idiot asking a question that should be basic, but I swear I have been seaching all over the place and can't find the answer.
View 2 Replies
View Related
Jul 31, 2013
I have an issue with Illustrator CS6, running on 10.6.8. I'll have an object selected, and I'll be using my Swatches panel to edit the colour of the object's fill, let's say. Then I will want to edit the colour of the stroke – as soon as I hit the stroke square in my toolbox, the Swatches panel disappears and the Color panel jumps out instead. I have to close the Color panel, and then reopen the Swatches every single time. Workspace: "Essentials" I don't have the Auto Collapse Iconic Panels on...
View 1 Replies
View Related