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


ADVERTISEMENT

Illustrator Scripting :: JavaScript Create Opacity Mask?

Aug 14, 2013

I am looking for a way to create an opacity mask through JavaScript. My program has the correct items selected, I just can't seem to find any documentation about creating an opacity mask.  If I run the program as is, I just need to click one button ( "Make Mask") and the desired process is completed. Of course I would love to find a way to do this programmatically. 
 
If I cannot access Opacity mask, is there a way to manually do this through grouping and blending or something?

View 6 Replies View Related

Illustrator Scripting :: Use Of Data Set To Translate Text In Files?

Apr 29, 2011

What would be the best strategy on the usage of data set to translate our product packaging. It's quite complex as we have several languages on the same packaging. Moreover, we have different text sources that would require to be translated in different sets of languages.
 
I have already looked into the data set and I tried to get familiar with it. How to create the data set and how to name the different variables knowing that there are different source texts for a particular region (region means a set of languages) and other texts for another region... The idea is to export this into one XML file with well identified elements that can be split with a tool, sent for translation according to their region then merged back into one single file to be imported back into illustrator
 
Region 1:
en-US
text 1
text 2
 
fr-FR
text 1
text 2
 
de-DE
etc...
 
Region 2:
en-US
text 3
text 4
 
ru-RU
text 3
text 4
 
Region 3:
etc..
 
It seems that the formatting such as bold, italic and so on is not exported into the data set which is quite embarrassing.

View 9 Replies View Related

Illustrator Scripting :: How To Move / Translate / Reposition The Group

Jul 10, 2013

I have a document with a single layer and a single group (GroupItem) in that layer.

Unfortunately, I didn't create the .ai file, so I don't know exactly what is in the group; however, there appears to be a bunch of complex clipping masks and gradient effects, etc. deeply nested within it.

I've successfully scripted a few tasks like resizing the group with no ill effect... in other words, this works as expected:
 
app.activeDocument.activeLayer.pathItems[0].resize(50,50);
 
However, as soon as I try to move/translate/reposition the group, all the effects/masks seem to go wonky, I've tried all of the below with no success (200 is just arbitrary as a test):
 
app.activeDocument.activeLayer.pathItems[0].left = 200;
app.activeDocument.activeLayer.pathItems[0].translate(200,0);
 
I have no problem moving the group around on the document with my mouse... all the effects/masks are still nice and clean, so I'm confused as to why I can't do the same thing via JavaScript.

View 3 Replies View Related

Illustrator Scripting :: How To Get Similar Transforms With Rotate And Translate

Nov 5, 2012

I want to get similar transforms with rotate and translate as I get it with the Transfommation Effect on multiple copies. But somehow the rotation of the Filter puts a different transform than doing it with rotation in js. With js the copies get rotated around a center, that is on the same level for all objects. With the filter the translations seem to have an different origin/direction. I dont get the logic how to get the same output with js.

View 5 Replies View Related

Illustrator Scripting :: Changing Opacity Of Text?

Nov 25, 2013

I'm trying to change/access the opacity of a text object (Illustrator CC). In the documents, I found that it's represented by a text frame object, but it doesn't have opacity property. Text range and character attributes don't have it either, so I'm wondering: is there any way of accessing/altering the opacity of a text object using Javascript?

View 5 Replies View Related

Illustrator :: Opacity Mask Slows Rendering?

Mar 19, 2013

I use a simple opacity mask on some equally simple (but large) artwork. It slows down the screen rendering so much as to make the file almost unworkable with the preview turned on.

View 1 Replies View Related

Illustrator :: Opacity Mask Artwork Link

Aug 28, 2012

So, I'm having trouble with CS6 Ai and the artwork link with the Opacity Masks...for instance, I have placed a black-white image that I am using as a "grunge effect" mask over a group within my artwork. The problem I am having is that when I do one of two things (move the artwork itself or copy/paste the artwork into another file) the mask does not remain. I have the little link selected on the opacity mask that says "Link to artwork".  I also tried "Expanding" the artwork to no avail. Am I missing a setting or something that would allow me to "finalize" a piece of artwork that has an opacity mask applied so that I can use it elsewhere?
 
I opened Ai on my office computer and tried an opacity mask and it worked as far as moving the artwork around within the same artboard. But, if I copy and paste the artwork to a new Ai file, the mask does not remain. Is this normal?

View 2 Replies View Related

Illustrator :: Opacity Mask Applied To Multiple Layers?

Feb 14, 2013

I'm trying to apply an opacity mask to multiple layers (which happen to be contained within a Layer Mask). When I make the Opacity Mask, it takes all of the stuff on different layers and compresses them to a single layer (see attached images). I would like to keep the data on their assigned layers for later editing. I've done this before, but I have a feeling I have a setting or pref de-selected somewhere. Could the layer mask be the culprit?

View 6 Replies View Related

Illustrator :: Transparency In Overlapping Objects Using Opacity Mask?

Jan 15, 2013

I'm in the process of drawing a site plan which contains buildings, roads and wooded areas.  I want to draw roads which go through the wooded areas.  I want both the road and the woods to be opaque except where the woods overlaps the road (I want the wood to be partially transparent at the overlap).  Example of the effect I want is shown below.  I don't get this effect when trying to use blending transparency modes.  I'm sure it can be done with the opacity mask but I've tried all sorts of combinations and not managed to get this effect.

View 9 Replies View Related

Illustrator :: Traces Of Shape After Using Opacity Mask And Importing To Photoshop

May 22, 2012

Macbook
OS X lion
AI CS5
 
I created this logo in Illustrator. I made my basic shapes with a pen tool, put a vector grunge texture over the top of the shapes and then used "make opacity mask" to get my grunge effect. As you can see in the screenshot of my illy it is all very clean and looking like it should. When you open my other picture you can see that once I transferred (cmd+copy cmd+paste) the logo into PS you can now see faint lines of where the shapes used to be *highlighted in red*. I also tried placeing the .ai file in ps but got the same effect. I am using all pantone colors on the logo, both documents are set to 300 dpi....err I cant think of anything else. PS is in RGB, Illustrator is in CMYK (but using Pantone)

How do I get my logo to look as good in PS as it does in Ilustrator?

View 23 Replies View Related

Illustrator :: Copy / Paste Type Object With Opacity Mask

Dec 11, 2012

I'm using AI CS6;
 
I have a type object with an opacity mask created in one document. When I copy and paste this object into a new file the text is pasted without the opacity mask attributes. I can separately copy and paste the opacity mask object but then I face a tricky realignment to repeat.

View 5 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 :: Layers Palette Stuck In Opacity Mask Layer Mode CS6

Aug 22, 2012

I have two layers. Upper most with text is locked.Bottom layer is an image I have applied a transparency/gradient mask for the raster image. Now, seems my layers palette is stuck in a mode called 'Layers (Opacity Mask)'.Not seen this before, but this is CS6. How do I get out to the main, root level of the layers palette?

View 1 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 :: 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 :: 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 :: 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

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 Replace Instances Matching Height Or Width Of Items

Nov 26, 2011

Im struggling with the correct use of symbol / symbol items in applescript. I can successfully list the symbols used on the page, but I cannot select them. How I can select all the items on the page that are Symbol Items of symbols named "Apples" but not oranges? After that I hope to replace the instances matching the height or width of the items whichever is greater with a 3rd item name. Javascript is always an option as well but I had the same difficulty.

View 14 Replies View Related

Illustrator Scripting :: Cycle Through All Path Items In Document And Convert To Outlines

Dec 28, 2012

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.

View 2 Replies View Related







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