Illustrator Scripting :: CS5 - Change To Global Rulers Is Scriptable?
Nov 18, 2010
I wonder if the CS5 command "Change to global rulers" is scriptable. When I try to record it as an Action script step, it is not recorded and I do not see anything in the JavaScript-ing guide on setting this programatically either.
We've purchased an eps file that claims that you can change the global swatch settings, but when I double click the swatch and change the color - it doesn't change anything. If I cursor over the entire art and double click the swatch to make the change, it changes the entire art to a single color. This art has hundreds of sections within it - with lots of various gradients in it. If I choose a single layer to change the colors in the gradient - I can't get the gradient colors to show up, nor can I even get it to change over to the standard black and white gradient. So, I don't know what to do here. Am I doing something wrong here in making the global swatch change? If I didn't know better, I'd say that the art has been completely divided.
A few years ago I learned in school the usefullness of global color. I used it today and it was very usefull to quickly change the color of a lot of different objects at the same time.
HOWEVER; I remember they also tought me that it was also possible to change the brightness or shading or something inside one global color.
for example lets say I picked a red as a global color, and I have 10 objects all in that red. Then it should be possible to let 5 of those objects have a lighter version of that red color.
Then afterwards when I change my global color to green, all the objects change to green, and those 5 objects now have a lighter green color.
Am i remembering this correctly, and if so; how do I apply this? Because I cannot figure it out...
We get artwork from outside agencies with color boxes like those shown (CMYK, in percentages of 30, 50 and 100). Their color names may vary, or often the colors aren't in their color palette at all. I am supposed to recolor the boxes with our standard-named, global colors in my own swatch library. Two questions:
1. Is there a way to grab the three cyan boxes (for example), and recolor them with the global Cyan swatch, WITHOUT having the %tint in all three boxes become 100%?
What I do now, over and over in each file we receive: Select the three Cyan boxes, click on the "C" global swatch in my palette, watch them all change to 100%C. Then manually click on the left cyan box and change the tint back to 30%, and for the middle box, change it back to 50%. Etc. for the other colors. This is a PITA, and it just seems like there should be a quicker way.
2. Is there way to then recolor ALL the cyan elements (strokes, fills, gradients) used in the art with the same global cyan swatch, without changing the tints?
I frequently record Illustrator Actions. My actions are quite long, but they all involve three common steps:
-Assigning Notes to shapes -Assigning Swatches to shapes -Selecting shapes that have a specific notes
I often need to re-record my actions to repeat all the steps, but to change the notes/swatches that are selected/assigned during the action.
Illustrator has a re-record command. This command is great for changing the value of the note in number 3 of my list. However, it does not work for items 1 & 2 in my list. For these items I have to delete the old step in the action and then record a new step with the new swatch/note.
I know macros in Microsoft Office have an editor which allow you to change values in actions. Is there anything similar for Illustrator actions?You can save an Illustrator action and open it in Text Edit. However, all the attribute/swatch values are saved as weird strings, so I don't know how to change them.
I am trying to change the color of all items on and under a specific layer.I have been successful changing the color of specific types of objects (paths), but I need to accommodate all the types on the layer and sub layers.
I can recurse to as many sub layers as I expect, but how do I accommodate the page Items, path Items, group Items, compound Path Items, etc.I was thinking of pushing everything to an array, but I have no experience with arrays...
I use a PC and have Illustrator CS4. When I open AI, the rulers do not appear. I have saved my workspace with them showing, but when I open that workspace, they do not appear. I have to go up to View>Show Rulers (or do the shortcut). I know this is extremely minor, but my rulers appear in ID CS4, so I'm wondering why I can't set AI to do that, too. It's like having to plug in your keyboard every day...you just want it to be ready to go when you get ready to work.
I managed to write this javascript. It automatically changes the colors from one swatch (byName) to another (byName) in my opened illustrator file. But if this one color doesn't exist as a fill or outline color in a file, I get an error message, because the script can not detect the color. The script stops. I am working on a batch of Illustrator files with 3 colors to change, but some files contain just 1 or 2 of the colors.Is there a command for javascript which says: "Only change the color, if the color appears"?
Here is the script:
var docRef = app.activeDocument; with (docRef) { var findColor = swatches.getByName('TSB Dark Blue').color; var replaceColor = swatches.getByName('TSBDB').color; [code]....
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?
Is it possible to change the cursor while a script is running? I have several scripts which work on large numbers of objects, and it would be very useful to have the cursor change to the spinning color wheel or hourglass while the script is looping away.
I understand that Adobe's JavaScript Toolkit would let you build a progress-bar dialog, but the delays are rarely long enough to justify such a thing. All the same, a change of cursor would reassure users (and not just me!) that things were indeed happening.
I want to overprint a PMS colors using Applescript. I though if I changed the property of the selected items fill color from (fill overprint:false) to (fill overprint:true) it would work. This doesn't seem to change a thing.
This is the script I am currently using:
script ChangeOverprint tell application "Adobe Illustrator" local docRef
[Code]....
This is the picture of a simple document I created. The elipse has fill overprint:true. The polygon has filr overprint:false. The original value for the property fill overprint was false. I changed it in the script to true. Which the log shows it changed.
I created an action to change the width of an image. I execute the action using DoScript javascript method.
The first action Obj1 will select the whole image and second action Obj2 will open the transform panel and change the width of the image.
app.Open("D:LWW_Castoff45991_09_03.eps") app.DoScript("Obj1", "LWW") While (app.ActionIsRunning) Thread.Sleep(500)
[Code]...
In the above code, the second action 'Obj2' is not getting executed. Both the actions are getting executed individually. Let me know the problem and how to execute both the actions.
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.
I am trying to create a script who could act as an Autocad plot (ie convert each color to black, with a different line weight).
Here is the first script I melted, who create my Black swatch
if ( app.documents.length > 0 ) { var myDoc = app.activeDocument; //add Black swatch var newSwatch = app.activeDocument.swatches.add() var newColor = new GrayColor(); newColor.gray = 100; [Code] .........
And here is the second one, who replace one color by Black (it don't change the text, nor the lineweight yet…
if ( app.documents.length > 0 ) { //test de dialogue function csDialog() { var fabGroup = app.activeDocument.swatchGroups.getByName('Fabrics'); var allFabs = fabGroup.getAllSwatches(); var fabNames = Array();
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?
When I open the .AI I noticed that the reference to the visuals is under a %DocumentFiles section: %%DocumentFiles:/Volumes/Storage/Projects/Client/AAA001/visuals/retouc hed.psd %%+/Volumes/Storage/Projects/Client/AAA001/visuals/flattened.jpg
I need to replace "/Volumes/Storage/Projects" with "/Volumes/Projects". (There are some more complex replacements I need, but let's start here.)
I need the finished script to create a rectangle with no fill and a 20% gray stroke to outline each artboard. I dug this up off these boards, which works perfectly except the rectangles created have no fill or stroke. certainly save me a lot of time drawing rectangles on a daily basis.
#target illustrator var docRef = app.activeDocument; var artboardRef = docRef.artboards; for(i=0;i<artboardRef.length;i++){ var top=artboardRef[i].artboardRect[1] ; var left=artboardRef[i].artboardRect[0]; var width=artboardRef[i].artboardRect[2]-artboardRef[i].artboardRect[0]; var height=artboardRef[i].artboardRect[1]-artboardRef[i].artboardRect[3]; var rect = docRef.pathItems.rectangle (top, left, width, height); rect.fillColor = rect.strokeColor = new NoColor(); }
I'm trying to use this command to change the colour of objects inside of a document using applescipt but i keep getting an error "adobe illustrator "can't get color"" the colour exists and is active on a document. I have read the manual on variables and i'm a little lost on what i'm doing wrong, heres what i've got so far:
tell application "Adobe Illustrator"
if color is "C=0 M=0 Y=0 K=90" then set color to "C=0 M=0 Y=0 K=90" end if end tell
i understand this is quite basic but its all i have to start with at the moment
I'm trying to use some images in my ScriptUI dialog, but I want to use a "relative" path name, and I can't seem to get it to work.For example, this myScript.jsx works just fine, but as you can see, I'm using an "absolute" path name to transparencyGrid.jpg:
var w = new Window ("dialog"); var f = new File ('~/Desktop/transparencyGrid.jpg'); w.add ("image", undefined, f); w.show ();
However, I want to be able to use a relative (to myScript.jsx) path to point at transparencyGrid.jpg, like this:
var w = new Window ("dialog"); var f = new File ('../../../transparencyGrid.jpg'); w.add ("image", undefined, f); w.show ();
But, I can't seem to get this to work because relative paths seem to be relative to the current folder, Folder.current, not the location of the currently executing script.I say that because when I do this:
alert(Folder.current);
The only thing the alert message shows is a backslash (/), indicating to me that the current folder is the root of my OS, but I thought it would be the folder where myScript.jsx resides.
So, is there a way of setting Folder.current to the location of the actual script?
How to go about making it only change the color of text frames on the active layer? In the final script I will hide all other layers so if it could be done by a visible attribute more easily that would work just as well.
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.
Almost every time I add a linear gradient to an object I want to change the angle from 0 to 90 degrees.
Is there a script that I could use for this, so that I could assign a keyboard shortcut and press that instead of clicking the box & typing 90 all the time? (i.e. select an object, run a script & it would apply the standard black to white linear gradient at 90 degrees instead of 0.)
Is there a way to export a document @ a different resolution than 72DPI? I know I can set the horizontal/vertical scale to save it at a larger dimension at 72DPI, but I need the file to be actual size and 300DPI.
This is part of a larger process, and I'd prefer to do the entire process from Illustrator, and not have to open the files in Photoshop to change the size/resolution.
Also, is it possible to change the color mode to CMYK or Greyscale for the exported Jpeg?