Illustrator Scripting :: Adding A Number To A Variable

Feb 3, 2014

I am trying to add a number to a variable.  var n=y+36...So I am creating a new variable (n) whose vaule is 36 points more than the variable "y".

View 5 Replies


ADVERTISEMENT

Illustrator Scripting :: Read A Number From A Variable And Rotate A Shape

Jul 26, 2012

I'm using the variables panel in Illustrator to pull a data set I've got.
 
For example there's 2 text variables and 1 number going from 0-359. I'm looking for a script which looks at the variable name and pulls the number, then uses that number to rotate a shape by that many degrees.

View 2 Replies View Related

Illustrator Scripting :: How To Automate Importing Variable And Datasets Into Graphs Via Scripting

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

Illustrator Scripting :: Passing Variable Via BridgeTalk

Jan 9, 2013

I now understand about serializing the message, and loading and running external scripts via opening, reading, and sending them within the context of BridgeTalk. 

I have a palette window which contains a listbox of items that searches and lists the contents of over 400 products. This pic of the template below is typical for all items.  The imprint area shown will change depending on the product.
 
Script #1:
When the user selects a product from the list, that selection is used to open a file (illustrator template) for that item that shows a guide path box  with height and width information for the imprint area on the product.  The currently opened illustrator document contains the artwork they are working on at the time.  This artwork is copied and pasted to the newly opened template file.
 
Script #2:
This script contains  an array of all the products in the palette list.  Within each index of that array, each item will contain the following information:
 
Example (the name property of each item will match the name of the index box selection from script #1):
 
var itemArray = new Array();
//p may be saved at index 0 of itemArray
var p = new Object();
        p.name ="P- Shape P";
        p.width = 189;
        p.height = 103.5;
        p.pos = [300,564];
 
I need to send the selection from script #1 to script #2 so I can loop through the array and find a match, at which point the information stored in the properties of the item will be used to scale the art and place it in the correct position on the template.  Is there any way to send a variable from script #1 containing the name of the selection via BridgeTalk and have it stored in a variable in script #2?  If not, I read somewhere where it might be possible to write/save it to disk and have the second script read it. 

View 8 Replies View Related

Illustrator Scripting :: Variable Width Tool (JavaScript)

Feb 6, 2013

I am looking for any info on scripting the Variable width tool (Javascript).
 
Background: By adding a gradient to a variable width strock you can create nice 3D looking  Shapes (see example)

this is a straight vertical line with varied widths, then hit with a gradient.
 
Goal: My hope is to write a script that will take a "Profile" or "Shape" and convert it to a Variable width line. (see Example)

The Black line is to have its widths modified
The Red line is how wide the line needs to be.

View 10 Replies View Related

Illustrator Scripting :: Evaluate If A Number Is Even Or Odd?

May 15, 2013

I have to write a loop statement wich has to be able to identify odd numbers from even numbers:

View 2 Replies View Related

Illustrator Scripting :: How To Use Imported Text As A Number

May 13, 2013

Is it possible to use an imported text as a number? I would like to import a .txt tab formatted file containing some values (ex: 22.5; 50.00; 150.00, etc.), and I want to treat those values as numbers in my script. Is this possible?

View 2 Replies View Related

Illustrator Scripting :: Rounding Text Size To Nearest Whole Number?

Jun 13, 2013

I've had to rescale some artwork, but now I'm left with type sizes that are 71.68px tall, 34.51px tall, etc.
 
Is there a script that'll snap all the text in a document to it's nearest whole number or 0.1 decimal?

View 7 Replies View Related

Illustrator Scripting :: Regex - Limit Input To A Positive Number (float Or Int)

May 14, 2013

I wish to limit the user input of and edittext to only allow a positive number, float or int. I do not yet know my Regex good enough to do this. I realize that I must get better at regex but in the meantime how to do this ?
 
I have used this so far on the edittext:
 
function checkTextInput()
{
if (this.text.match(/[^0-9.]/g))
{
this.text = this.text.replace(/[^0-9.]/g, "");

}

 
Which matches
000.0001
0.45.000.1
...1
which is not desired.
 
Desired is
0.n
.n
n.n

View 1 Replies View Related

Illustrator Scripting :: Allow To Select Image To Replace Any Number Of Selected Files

Apr 18, 2013

I've written a script to allow you to select an image to replace any number of selected files.  Each file starts out as an embeded image with a .note to determine where the basis of alignment for the new file should be (i.e. "top," "bottom," "left," "right").  You'll find the code below:
 
#target illustrator
 
if (app.documents.length > 0) {
    var docRef=app.activeDocument;
    var docSelection = docRef.selection;
    // ** Get new file
   
[Code]...
 
For some reason, the ".note" added at the end of the script gets erased once the script is complete.  I can even get it to confirm that it applied the note to the image, but once it's complete, it's gone. 

View 6 Replies View Related

Illustrator Scripting :: Adding Graphic Styles Using VBA?

Apr 7, 2012

How would I go about applying graphic styles to a path using VBA? I would imagine the following line is wrong because it doesn't work.

idoc.GraphicStyles("02-S").ApplyTo (isquare2)

View 5 Replies View Related

Illustrator Scripting :: How To Read Real Number Data From Selected Columns In Excel Spreadsheet

Oct 27, 2013

Problem:

How to read real number data from selected columns in an Excel spreadsheet into an illustrator javascript array variable, so that then I can use this information to construct an illustrator polygon. 
 
Further information:

I am new to javascript (and not much of a programmer in the best case, but do have some basic knowledge using ancient languages like FORTRAN 88). I am sure I am just missing an important step here despite all morning browsing with Google for answers (something to do with variable definition I assume?). I have some survey data defining the outline of features in map view listed in a string of point (x,y) values in adjacent columns in excel (these x,y point values calculated from GPS data using a commercial program to converted 3D position to a 2D x,y by geoid projection, and then in excel to re-scale point locations to illustrator’s artboard).  What I am trying to do is select columns of x,y value pairs in an excel spreadsheet, copy these values to the clipboard, and then develop an IA JavaScript to draw a polygon through the specified set of x,y points. It seems easy enough to script illustrator to draw the polygon once I get the values from the clipboard are in a javascript array (lots a good tips here [URL] ....), but pulling in the clipboard data seems to be beyond me. I have tried populating a defined array with various combinations of array declarations and app.paste(); or windows.clipboardData.getData('text/plain'); with no satisfaction. I then had the idea to try to pull in the clipboard to one long continuous string, place that in a text box (see see its structure), andthen read and split up the text in a loop to populate the JavaScript array…but that deposited a complex illustrator table object into my text box, and several attempts to force the clipboard to paste text did not work (again probably having problems understanding variable type declaration).
 
I would be happy to find any method of scripting the pull of the selected on an excel spreadsheet for use in an Illustrator script…so if I am making this all harder than it needs, be I would be grateful to know that also!

View 4 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 :: Adding Lab Colors To Swatch - Not Implemented

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

Illustrator Scripting :: Adding New Line And Spaces In Between Text In AI Script

Apr 2, 2012

areaText.contents = "This is an Area Text in a rectangle. See how it flows to the next line.";
 
/*
i want to break the sentance from 'Text' ie i want to add new line in between and also some more spaces.
*/
 
For example: I want to write the above text like this way

this is an Area. Text in a rectangle. See how it flows to the next line.

View 2 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 :: Adding Serial Numbers Apply To Multiple Files In Selected Folder?

Dec 19, 2011

How to make the following script for adding serial numbers apply to multiple files in a selected folder?
 
var docRef = app.activeDocument;
with (docRef) { 
var docName = name.substring(0, name.lastIndexOf('.'));
var artRight = visibleBounds[2];

[Code] .....

View 6 Replies View Related

GIMP :: How To Make Curves Spline Get Variable Instead Of Number

May 9, 2012

I've been trying to make gimp-curves-spline get variable (which is number)instead of number and I get error.

For example -when I do:
*(gimp-curves-spline drawable 0 6 #(0 0 0 15 255 255))*

everything works well as it should be.

but if I do:*(define spoint 15)*
*(gimp-curves-spline drawable 0 6 #(0 0 0 spoint 255 255))*

I get an error: *Error: Item 4 in vector is not a number (argument 4 forfunction gimp-curves-spline) #( 0 0 0 spoint 255 255 )*As you can see, all I did was replacing the number 15 with a variable(which is a number) I also check it is a number by the *number?* type predicate

View 2 Replies View Related

AutoCad 2D :: System Variable To Keep Stacked Fraction With Leading Number?

Jul 5, 2011

System variable to keep a stacked fraction with the leading number?

We open the same drawing on different computers at work and on one computer the number will be 21/2 but on the next computer that opens the same dwg the 1/2 will have been bumped down to the the following line. I don't know if this is a problem with the autostack properties, although I can't find anything about that, or if its a problem with the tabs.

I'm completely at a loss and its becoming a problem because if one person opens a project to plot it and it looks fine but the next person opens it and every mtext in the dwg is wrong it becomes very time consuming to fix.

View 5 Replies View Related

Illustrator Scripting :: Adding File Name And File Full Path To A Page

Mar 28, 2012

I'm new to scripting What I want to do and don't know how to go about it is to run a script that collects the saved file name and the full path where the file is saved on the network and displays it on my document.

View 2 Replies View Related

Illustrator Scripting :: Adding Text To A Text Frame?

Mar 19, 2013

I have yet another question. I can see the text in a text frame with a script like this,
 
var doc = app.activeDocument;
var myTextFrames = doc.textFrames[0];
var myTF_Content = myTextFrames.contents; // this will return the string inside the text frame
alert(myTF_Content);
 
but how do I add some text to the beginning of that text? lets say that this is my textFrame[0] = "this is a simple test string".what is the proper way to add text like the number one and a period to the beginning?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Assign Variable Based On The Number Of Characters To Be Removed

Apr 1, 2013

(defun layun (target_obj / original_layer original_layer_info target_obj_atts new_layer )(setqoriginal_layer (cdr (assoc 8 (entget target_obj)))original_layer_info (tblsearch "layer" original_layer)target_obj_atts (entget target_obj));setq(if (or(wcmatch original_layer "*-P123"); REMOVES 4 CHARACTERS(wcmatch original_layer "*-P123456"); REMOVES 7 CHARACTERS(wcmatch original_layer "*-P123456789"); REMOVES 10 CHARACTERS );or(progn(setq new_layer (substr original_layer 1 (- (strlen original_layer) ??))) ; NEED TO ASSIGN VARIABLE TO MATCH THE NUMBER OF CHARACTERS TO REMOVE(if (not (tblsearch "layer" new_layer))(progn(entmake ;;;begin to make new layer(list'(0 . "LAYER")'(100 . "AcDbSymbolTableRecord")'(100 . "AcDbLayerTableRecord")(cons 2 new_layer) ;;; layer name(assoc 6 original_layer_info) ;;;re-use original linetype'(70 . 0) ;;;flags - use default flags(assoc 62 original_layer_info) ;;;re-use original color);list);entmake);progn);if(entmod (subst (cons 8 new_layer) (assoc 8 target_obj_atts) target_obj_atts)));progn);if);defun

assign a character where ? is shown so that it matches with the number of characters to remove based on the 3 lines above (see wcmatch lines).  At present, whatever number I replace that ?? with, it removes that number of characters from the layer that I selected (if it meets that WCMATCH criteria).  Another option which may be more difficult is to be able to have the routine look at the object layer and if it contains -N- or -D- or -NEW- or -DEMO- then to remove all the characters that follow these layer modifiers.  This way I can cleanly add another project modifier behind these modifers. 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Adding Variable To Existing File

Oct 4, 2012

I have attached 2 lisp files. datblkx5 makes a block of selection, inserts the block with a 5x distortion, explodes it, and corrects the text for width factor and text height. This one works fine.

I wanted to add the feature of scaling my selection with a user input value. This is the lisp datblkxxx. This one doesn't work. (that is it doesn't correct the text for width factor). I can't figure it out.

View 3 Replies View Related

Illustrator Scripting :: Access Graph Data Through Scripting DOM?

May 6, 2012

Can you access graph data through the scripting DOM?

View 3 Replies View Related

Maya Modeling :: Adding N Number Of Edge Loops At Once?

Oct 25, 2012

I know there is the insert edge tools, but I am looking to quickly add a variable number of edge loop either evenly spaced or sporadically space in one operation.

I'm coming from Lightwave3D so excuse me if I try to relate tools to it here.

[URL]

View 2 Replies View Related

GIMP :: Adding Frame Number Counter To GIFs

Mar 2, 2012

I'm in the process of making several .gifs that I would love to add a frame # counter.

Is there any way to add a frame counter to .gifs?

View 1 Replies View Related

AutoCAD Map 3D :: Attribute Data Editing By Adding Interval To Number

Jul 30, 2012

Is there a way to edit the an attribute data if it is defined as number to add a value of .3 to the number being displayed in this attribute box. The feature is a point and i'm looing to add the .3 value to elevation attribute value that weren't pulled from a surface or created using object data.

View 1 Replies View Related

Illustrator Scripting :: Create Mirror Text And Stroke Text In AI Scripting

Mar 16, 2013

the Script of creating mirror text and stroke text in Adobe illustrator scripting.

View 4 Replies View Related

Illustrator :: Can AI Action Name A Variable

Jan 20, 2014

I'm making an action for folks at work to use (I'm not well versed enough in scripting to script what I want to do, but an action is passable), and part of this action adds a variable into the open document. The thing is, the variable has to be named a certain thing and it keeps defaulting to Variable1.
 
Currently I have it set up to create the variable, then open the Variable window and then have a Stop with a note on what to do, but if there's a way to just re-name the variable in the action itself that'd be best (I need this to be as... well, for lack of a better term/phrase, idiot-proof as possible).
 
Without using a script, is it possible to have an AI action delete an existing variable? I.E. if there's a variable named 'test' by default, can I have an action delete the 'test' variable? I tried recording this but it didn't work and I wasn't able to get consistent results.

View 1 Replies View Related

GIMP :: Unbound Variable Error With No Variable?

Nov 5, 2013

I'm attempting to write a batch script to add some layers to a pre-existing image and save a copy. I've gone through the tutorial, and have run the demo code from Basic_Batch with no errors, but my (what I think of as simple) script throws an "Error: eval: unbound variable: ?" It also seems to cascade the error to other scripts, as I then get "unmatched parentheses: 2" errors from what I assume to be the script immediately following my own during Script-Fu load. This occurs whether running from batch or clicking "Refresh Scripts" from the Script-Fu menu.

What I could find on this forum and Google suggests that I may be required to 'define' one or more of my variables before using it, but for the life of me, I can't figure out which one that would be, and the error (reporting that '?' is undefined!?) I've quintuply (probably more ~_^) checked my parenthesis matching, but they look fine to me.

In case this was an encoding issue, I've tried saving my .scm file as both UTF-8 and ANSI. I should also note that I'm running Windows 7 x64 in English-US.

Script:

(define (script-fu-build-imagebasefilemytext)(let*((image (car (gimp-file-load RUN-NONINTERACTIVE basefile basefile)))(drawable (car (gimp-image-get-active-layer image)))(title (car (gimp-text-layer-new image mytext "Courier" 18 UNIT-POINT))))(gimp-image-add-layer image title -1)(gimp-image-clean-all image)(gimp-file-save RUN-NONINTERACTIVE image drawable "K:\\Images\\Temp.gif" "Temp.gif")));

Since I intend for this script to only be run from batch, I haven't bothered including the typical register stuff.

View 6 Replies View Related

Illustrator :: Disabled Variable Width Profile

Nov 29, 2012

I have a pre-existing graphic uses a stroke with variable with profile (I think) or a special brush to make it look like it's hand drawn.  I'd like to apply the same effect to a few new illustrations to keep the style consistent.  For whatever reason when I ungroup the graphic and select one of the paths, the stroke weight and variable width profile remain disabled (see pasted toolbar graphic below).  The brush still says "Basic" despite the fact that visually it is certainly not the basic brush.

Selected Path

Toolbar (I realize that it says Group instead of Path, but even if I ungroup again and select the path the same options are disabled).

View 3 Replies View Related







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