Illustrator Scripting :: Can Tint Be Adjusted For Items On Page That Have Spot Color Applied

Sep 27, 2012

I have been trying to mess with and target "tints" via javascript but either I am not understanding something or it cant be targeted as I had hoped, so I am looking for direction and guidance. I have a spot color assigned in the color swatches palette, and have drawn a few boxes on the page using this spot swatch. I then try to alter the tint using JS code.
 
sel[i].tint = // whatever number
alert(sel[i].tint) // This alerts fine
 
The alert shows a change taking place but it never gets applied to the item, the actual item never gets changed. I know things are properly targeted as I can change other attributes fine. When I look in the JS documentation it just shows for when creating a new spot, not for ones that already exist on items, I cant seem to find an example otherwise.
 
Can tint be adjusted for items on the page that have a spot color applied?

View 8 Replies


ADVERTISEMENT

Illustrator Scripting :: Color Value Of Spot Colors Cannot Be Adjusted Via JavaScript?

Jul 17, 2012

color value of spot colors cannot be adjusted via javascript?

View 5 Replies View Related

Illustrator Scripting :: Apply Every Swatch Library Color To Path Items On Page?

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

Illustrator :: How To Preview Overprinting White Ink (spot Color) Or A Tint

Jun 21, 2013

how do I preview overprinting white ink (spot color) or a tint thereof?

View 13 Replies View Related

Illustrator Scripting :: CS4 - Remove All Hidden Page Items?

Jan 26, 2012

I'm trying to remove all hidden page items regardless of how many sublayers they are burried in. I wrote a snippet here that seems to only partly work. It removes all hidden page items unless two hidden items exist right after each other in the stacking order.
 
for (i=0; i<doc.pageItems.length; i++){
if (doc.pageItems[i].hidden == true){
doc.pageItems[i].remove();
}
}

View 3 Replies View Related

Illustrator Scripting :: Filter Page Items By Property In JavaScript

Aug 9, 2012

What is the Javascript equivalent to this AppleScript?
 
set xxx to every page item whose note = "John"
 
After looking at some of the tutorials, I pieced this together. Is there a better way of doing this? With 30,000 path items it took over a minute to execute...
 
docRef = app.activeDocument;
var pathLength = docRef.pathItems.length;
docRef.pathItems[0].note;

[Code].....

View 4 Replies View Related

Illustrator Scripting :: How To Find Out That Art Item Has Spot Color

Jul 4, 2012

I have a number of art items on a document, some of them are filled with spot colors and some of them are with process color.Is there any method by which I can find out which color type(spot or process) is applied to the selected art item?

View 4 Replies View Related

Illustrator Scripting :: Move A Spot Color To A Layer?

Oct 10, 2013

I am trying to grab specific spot colors and move them to separate layers for our cutting software. In this case I am trying to grab "perimeter cut" and move it to a layer called "tc 1" I get the following error when I try to run the script.
 
 #target Illustrator
 var idoc = app.activeDocument;
var ipath = idoc.pathItems;
if (ipath.typename == "SpotColor") {
if (ipath.spot.name == "perimeter cut") {
ipath.move(tc 1, ElementPlacement.PLACEATBEGINNING).
}
}

View 5 Replies View Related

Illustrator Scripting :: Getting Used Spot Colors In Color Legend On MAC JS Or Applescript

Mar 23, 2012

I'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. 

View 9 Replies View Related

Illustrator Scripting :: Adding Spot Color Using JavaScript - TRY CATCH Not Working

Mar 6, 2014

I am trying to add spot color in illustrator using javascript, TRY CATCH is not woking, it is adding again and again same color value with name of "spot color 1" and "spot color 2" ... 
 
try {
var myDoc = app.activeDocument;
var spotName = "FINISHING";
var spot = myDoc.spots.add();
 
[Code] .......

View 1 Replies View Related

Illustrator Scripting :: CS5 - Change Fill Color Of Selected Path Items

Apr 2, 2013

I'm trying to create a script in CS5 mac os10.6.8 that will change the fill color of selected pathItems. I need a simple script that will change a selected pathItem to cmyk values 2,3,15,0. I will then select this script and implement the action in a batch of 600 files.
 
I wish this process could be recorded as an action but when I record the action "add new swatch" I have to manually input the cmyk values, which will take forever for a batch of over 600 files.

View 15 Replies View Related

Illustrator Scripting :: How To Read Swatch Used For Fill Color Of A Page Item

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

CorelDRAW X4 :: Printing Spot Color Seps With Color Name On Each Page

Dec 23, 2011

We print out spot color seps every day using CorelDraw X4. After we print out the plates, I have to cut down the vellum that we print on so that we do not have a bunch of extra blank vellum on the sheet.

We make use of the info that is printed on the lower left of every page where it states something like the following:

S:DirectoryWhereTheArtworkisLocatedfilename.cdr

Wednesday, December 23, 2011  8:00 AM

Plate: 1 of 3

After I cut down the sheet, I then have to hand write the name of the spot color onto the sheet of vellum in marker.

Is there any way at all, to make it so that CorelDraw would actually add the name of the spot color that is printed on each page to the information that is already being printed to the lower left? Ideally, it could be placed in the same area where it's already printing the plate information on the last line.

Could it read:

Plate: 1 of 3  Color: Pantone 375

View 6 Replies View Related

Illustrator Scripting :: How To Iterate Story To Find If Characterstyle Is Applied To Its Textranges

Apr 18, 2013

Does source like below work?
 
characterStyle.parent == theStory.textRanges[i]
 
One more questions is if there might be a CharacterAttribute who belongs no characterstyle? Can I iterate charaterstyles to know all the font, bold .. information for all teh textranges?

View 5 Replies View Related

Illustrator Scripting :: Getting Page Count For A Multi-Page PDF File?

Jun 25, 2009

how to get the page count of a multi page PDF file?  I know you can then open each page using the PDFFileOptions (pagetoopen).  But I need to know up front how many pages there are to loop thru to open each page and process each page.

View 8 Replies View Related

Illustrator Scripting :: How To Find A Way To Loop Through All Items

Apr 6, 2012

I'm trying to find a way to loop thru all items in an Illustrator document and get their stroke and fill color.  Sometimes items are spots, sometimes documents are set to RGB or CMYK, etc, so swatches can be a mixture of things.  Is there an easy way to get the swatch name for each item?
 
For example, I can check if an item is a spot, and get it's color like so:
 
var c = app.activeDocument.pageItems[0];
if (c.strokeColor.typename === 'SpotColor') {
    var s = c.strokeColor.spot.name;
}
 
But if I try to get the name from an item colored 'Black' (which is set to Process Color, CMYK), then I'll need to do something else like:
 
var c = app.activeDocument.pageItems[0];
if (c.strokeColor.typename === 'CMYKColor') {
    var s = c.strokeColor.name;  // This returns undefined - not sure what I'm doing!!!
}
 
Is there an easier way to achieve this, other than getting the typename of each item, and then trying to figure out it's color name?  I was hoping something like this would work:
 
var c = app.activeDocument.pageItems[0].strokeColor.name;

View 3 Replies View Related

Illustrator Scripting :: JS / Accessing Menu Items In CS6?

Jul 16, 2012

I just got CS6, and I'm wondering how I access menu items using Javascript?Also, I'm looking at the CS6 JS reference, and it doesn't say whether app.activeDocument.selection is Read-Only. I would need this for my purposes in accessing the menu.The item I wanna access is Select > Same > Stroke Color. Seems simple enough.

View 5 Replies View Related

Illustrator Scripting :: Sorting Out Path Items?

Apr 14, 2012

I have a collection of circles and rectangles in my document. Is there any way to sort out circles from rectagles using JavaScript? Say i want to make my circles red and the rectangles blue.

View 8 Replies View Related

Illustrator Scripting :: How To Lock Items In A Document

Nov 19, 2013

how to lock items in a document?, I saw lots of tips on how to know if the object is locked, but I did not find tips like locking them.

View 2 Replies View Related

Illustrator Scripting :: Adding Custom Spot Colors

Dec 2, 2013

I 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]....

View 2 Replies View Related

Illustrator Scripting :: How To Add Methods To The Symbol Items Class

May 31, 2012

is there a way to extend existing classes? I am trying to add methods to the symbolItems class, but it doesn't seem to work. says it is not defined:
 
symbolItems.prototype.isIn = function(parentItem, runThis) {
//do something
}

View 5 Replies View Related

Illustrator Scripting :: Group Items Are Returning As Layers

Apr 5, 2012

I have a layer that contains two clipping groups (groups with a clip mask and other art).  When I call layer.groupItems it returns an empty array.  When I call layer.layers it returns the two clipping groups.  I need to know if these layers are clipping groups, but if they are coming back as layers how can I figure that out?

View 8 Replies View Related

Illustrator Scripting :: Random Delete A Selection Of Items

Aug 25, 2013

I am trying to create a script to specify a percentage of the selected items you want to remove.Here is what I have so far.
 
I still need to work out on the alert prompt and the if statement, but for now, I have the feeling that the selection.length keep changing each time Illustrator delete an object, and I don't know how to make it stick.
  
var selection = app.activeDocument.selection;
//alert prompt dialog for a percentage of deletion
for (var i = 0;  i < selection.length;  i++) {
    if (Math.random < 0.5) { //need to work out the percentage
        alert("yes")
        selection[i].remove();
    }
}

View 7 Replies View Related

Illustrator Scripting :: Get Width That Multiple Selected Items?

Apr 23, 2013

How can I get width that multiple selected items? (Not grouped.)
 
//---------- source code ----------
 var mm = 2.83464566929134 //unit conversion. (point->milimeter)
var W = docRef.selection[0].width/mm;
alert(W); 
//---------- source code ----------

View 3 Replies View Related

Illustrator Scripting :: Select Items On Multiple Artboard

Sep 27, 2013

I have script where I select items on multiple artboard but I can't seem to get get active art board of the selected item. Is this possible?
 
each artboard has a text item and I would like them in the same position on each of their own artboards that they are already one. right now it adjusts them all to one artboard. here is what I have so far
 
doc = app.activeDocument;
for(i = 0; i < selection.length; i++){
    var firstItemPosition = doc.selection[0].position;
    doc.selection[i].position = firstItemPosition;
    var activeArtboardIndex = doc.artboards.getActiveArtboardIndex();
    alert(activeArtboardIndex);
}

View 10 Replies View Related

Illustrator Scripting :: How To Speed Up JavaScript Looping Through All Path Items

Dec 5, 2013

I have a very simple javascript for Illustrator that is intended to render all filled objects semi-transparent. It works nicely but for large documents with many objects this takes ages, even beyond the time it would take to do it manually.
 
I'm wondering if there is any way to improve this script so it works in a reasonable time for large files? I'm running Illustrator CS5 on a Windows 7 64-bit Intel Quadcore i5-2400 @ 3.10 GHz System with 12 GB of RAM and an AMD Radeon HD 6350 graphics. Would upgrading to CS6 significantly improve the speed? CPU load is only at 25%, but I guess javascript cannot be run in multiple threads with the Illustrator engine? Is there another scripting language that would allow me faster processing of that task in illustrator or is my code just poorly optimized?

with (app.activeDocument) {
if (pathItems.length > 0)
{
for (var g = 0 ; g < pathItems.length; g++)
{
if (pathItems[g].filled == true)
{
pathItems[g].opacity = 50;
}
}
}
}

View 5 Replies View Related

Illustrator Scripting :: Looping - How To Create And Lock A Set Of Path Items

Sep 19, 2012

The first loop grabs the geometries drawn in the current document and rotates it around itself creating duplicates. The second loop is supposed to circumvent more geometries around the newly created geometries.

But instead of creating a radiant pattern, this code builds a tower: for the second loop everytime it grabs the last drawn geometry instead of what is in the "Original"
 
for NumPaths = 1 to frontDocument.PathItems.count
set myPath = frontDocument.PathItems.item(NumPaths)
For index = 0 To 30
set newPath = myPath.Duplicate
call newPath.translate(100*sin(6.14* index/30),100*cos(6.14* index/30))
        
[Code] .......

View 17 Replies View Related

Illustrator Scripting :: How To Resize Or Translate Opacity Mask Along With Items

Jul 25, 2013

I'm trying to resize a opacity mask by doing
 
transMaskItem.resize(
  10, //scaleX,
  10, //scaleY,
  true, //[,changePositions]
  true, //[,changeFillPatterns]
  true, //[,changeFillGradients]
  true, //[,changeStrokePattern]
  0.1, //[,changeLineWidths]
)
 
This resizes the item, but it does not resize the item inside it. I tried similar command with the translation command
 
transMaskItem.translate(
100, //([deltaX]
100. //[,deltaY]
True, //[,transformObjects]
True, //[,transformFillPatterns]
True, //[,transformFillGradients]
True, //[,transformStrokePatterns])
 
and similar thing happened. The item gets moved, but the object inside it doesn't.
 
How do I resize or translate an opacity mask along with the items inside it?

View 5 Replies View Related

Illustrator Scripting :: Select All Items In Document Based On SpotColor?

Jun 28, 2012

I'm trying to select every object with the color "CutContour" So far I've been trying:
 
myDoc.selection = myDoc.spots.getByName("CutContour"); I guess this obviouslly wouldn't work though because myDoc.selection is looking for an array of objects. However, I can't figure out how to loop through all the objects in the document and check to see if they contain the SpotColor.
 
I want to use the Select > Same > Stroke Color , but I heard that using that in Javascript isn't available unless you have CS6 (which I currently don't). Is it true that accessing menu items through scripting is a feature in CS6?

View 4 Replies View Related

Illustrator Scripting :: How To Hide / Show Individual Items In Document

Nov 18, 2012

I'm trying to hide all items in a document (and store each items original visibility state), iterate user pre-selected items and perform an export for each item in selection (I've got this part covered), and finally restore the visibility state of each item again (here's where the storing of original visibility state is needed).
 
I've found that I can iterate all items in the document using app.activeDocument.pageItems[i] where i is the page item identified by the i-th index in the pageItems collection.
 
What is not clear, however, is how to get the visibility state of this page item. Indeed, there is a property visbilityVariable associated with page items, but when I try to "inspect" its content using an alert message, I get "undefined".
 
Are there better ways to iterate all items in a document? Ideally, I'd like to access all items regardless of wether they're path items, group items, text frame items or what have you. I need this collection to read/write the visibility state of each individual item.

View 2 Replies View Related

Illustrator Scripting :: How To Customize Or Create New File Menu Items In CS6

Mar 28, 2013

I have developed a script to perform some Custom action in Illustrator. I want to make this script run from a a File Menu Item so it can be invoked easily. Is there a way to customize Illustrator to add a new menu item or modify the existing menu tems functions. For example if the script needs to be invoked when the user click "Save" is there a way that could be done.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved