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
ADVERTISEMENT
Feb 22, 2013
I have an XML file containing a number of data-sets each consisting of a number of text variables which I want to use to create a deck of trading cards. Each trading card consists of a Text Field for the title of the card and a number of icons, which are instances of various Symbols
I have written a script to create each card and i can load the variables into my javascript using: newCard.importVariables(new File(xmlPath));I now need to access the data in the datasets in order to populate the card.
To provide some context, this is an image of one of the cards with placeholder art.
View 10 Replies
View Related
Nov 6, 2012
We are introducing a new graph design, but has a problem with not being able to override the tick marks in the category axis in Illustrator CS5. A typical graph (line layout) can have 250 observations, and since we have the tick marks on full width, the graph gets "crowded" with black lines.
In the value axis there is possibilites for overriding the values, but not on the category axis.
Is there any way to script so that the tick marks in the category axis can be reduced/overrided to e.g. 1 in 20?
View 3 Replies
View Related
Mar 8, 2013
I would like to automate an action set that selects a raster image (linked file) that has been grouped with vector art and then converts that selected raster image into a vector (live trace)
I'm using cs5 on a mac. As far as format goes I have hundreds of eps files that all have at least one raster bitmap tif which was imported as a linked file and then grouped with vector art. So I will like to run a batch script command that will select only that bitmap raster image (because I want to maintain the present vector art in the file) and convert that bitmap tif to vector- and save the file which will hopfully be in vector format.
View 2 Replies
View Related
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
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
View Related
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
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
Feb 3, 2014
I would like to open a file dialog box seltect a CSV text file saved from Excel and import this into an array/variable/dataset in adobe illustrator using javascript. Have done some work with javascript but not a power user. Can't work out how to get the open dialog to appear.
Long term aim would be to use the data to plot a path which seems straighwforward enough, its the getting the info in bit I'm stuck on.
You do have to be able to select the file to import, this bit quite important.
View 2 Replies
View Related
Oct 17, 2013
I'm looking for a way to import text from a .txt file but I'm totally lost.
View 2 Replies
View Related
May 6, 2012
Can you access graph data through the scripting DOM?
View 3 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
Mar 16, 2013
the Script of creating mirror text and stroke text in Adobe illustrator scripting.
View 4 Replies
View Related
Jan 15, 2014
Quite new to Ai's scripting stuff.
I'm having a complicate time with Ai's save to jpg options vs artboard sizes and units conversions.
Say, i have a doc (from my client), which they inherited and enhanced for 10 years may be.
It's "supposed" to be in millimeters, but artboardRect gives me those values :
-0.27880000000005
436.191388980878
646.457
-0.20900000000074
which sound like weird points or pixels.
I need to export a jpg (or gif, or png), that will be X pixels wide. For the purpose of the test i set it at 1200.
var maxLargeurPx = 1200;
First thing, getting the artboard's width :
largeurArtboard = Math.abs(thisArtboardRect[2]-thisArtboardRect[0]);
// 646.7358
Then i try to have a multiply factor to use
coefExport = /*Math.round*/ (100 * maxLargeurPx / largeurArtboard);
// 185.54717397738
and then set my ExportFile jpg to this value (i can't give it a number)
// exportOptions.horizontalScale = coefExport
That's when it's getting fun : my images are 1204 px wide with or without clipping.
Of course, i "can't" resize the doc for each export, especially expecting to have dozens of those, with different values, dimensions, etc.
View 5 Replies
View Related
Jul 27, 2012
I wrote the following AppleScript to open a PDF file and export is as PNG. I am using Illustrator CS5.
The export command gets an error: Adobe Illustrator got an error: Can't get current document.
when it encounters the export command.
set inputFile to (choose file with prompt "Open PDF file to convert to PNG:") as text
set exportFile to inputFile & ".png"
tell application "Adobe Illustrator"
if not frontmost then activate
open inputFile as alias without dialogs
export current document to exportFile as PNG24 ¬
with options {class:PNG24 export options ¬
, resolution:300 ¬
, matte color:{red:0, green:0, blue:0}}
close current document saving no
end tell
View 5 Replies
View Related
Jun 20, 2012
Im trying to add a pdf on top of an existing PDF in illustrator using a script. This is supposed to be done by anyone at my firm so that is why I want it in a script. I also have a lot of other functions that works that will do some other stuff with this document.
Created this from the scripting guide but it doesnt work. Im pretty sure its the embedDoc var thats empty and i dont understand why. Im not sure if the File "points" to the directory of the script or the original file but Ive tried both ofcoarse.
This is the masterpiece
var embedDoc = new File("/temp/testfile1.pdf");
if ( app.documents.length > 0 && embedDoc.exists ) {
var doc = app.activeDocument;
var placed = doc.groupItems.createFromFile( embedDoc );
}else {alert("suck")}
View 4 Replies
View Related
Apr 7, 2012
Is it possible to reference layers or groups by their names instead of their index using VBA? If so, what is the sytax? I know you can do it in Extendscript, but I'm not finding info for VBA.
View 7 Replies
View Related
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
Mar 13, 2014
I am trying to close alert at once but the loop continues the alert, how can I stop the alert at once
var doc = app.activeDocument
var layersToTargetNameArray = ["Background", "Artwork", "diecut", "size", "sign off panel"];
for (var i = 0, il = doc.layers.length; i < il; i++) {
var curLayer = doc.layers[i];
[Code] ......
View 6 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
Sep 11, 2012
I added CS6 COM reference in my VB.NET application and after that I have the following basic object creation in order to convert a eps file to svg. But for some reason when I create this COM object it is launching the Adobe Illustrator application. Why it is doing like this? It’s a simple COM object why it is interacting with Illustrator Editor?
View 9 Replies
View Related
Jul 30, 2013
I'm working on a script with an UI element. I want all values of the 2. cloumn (Rasterkeilfarbe) returned in one array and all values of the 3. column (Klischeenr.) returned in another arry.
var farben = ["black", "red", "blue", "green", "bla", "blupp"]
var myName = myInput (farben);
// rest of the script
[Code]....
View 5 Replies
View Related
May 26, 2012
Is it possible to script a tabbed ui like this, i can't seem to get it to work,
My script for now:
#target illustrator
tabbed_ui();
//Functions
function tabbed_ui(){
[Code]....
View 2 Replies
View Related
Feb 7, 2012
Is it possible to loop thru the artboards (with Illustrator CS5) and only work with the pageItems on the current iterated artboard?
For example, if I have 3 artboards, with 2 textFrames on each artboard. And I add the textFrames sporadically (I add a TextFrame with contents "Text 1" on artboard 1, then a textFrame with contents "Text 2" on artboard 3, then a textFrame with contents "Text 3" on artboard 1, etc).
Artboard 1:
Text 1
Text 3
Artboard 2:
Text 4
Text 6
Artboard 3:
Text 5
Text 2
Is there a way to loop thru these artboards and get the textFrames tied to the appropariate artboard? So, on the first iteration of the loop, I'm looking at artboard 1 and only looking at "Text 1" and "Text 3", then on the the 2nd iteration I'd be working with artboard 2 and it's textFrames "Text 4" and "Text 6", and so on.
If I loop thru only the doc.textFrames, the order would be incorrect, with the way I added each textFrame. Instead of artboard order, they'd be in this order:
Text 1
Text 2
Text 3
Text 4
Text 5
Text 6
View 4 Replies
View Related
Dec 17, 2013
What if for some reason a person wants to actually make an XML file and stick some <![CDATA[]]> in it? I looked through some manuals & OMV fairly quickly to discover no methods for that. Was wondering if there was some technique.And, just as pointed out in the indesign forums, a string of "]]>" makes the script hang up and debugging have to be stopped with the final message "Cannot execute".
View 9 Replies
View Related
Mar 7, 2012
is there a way to pin certain scripts to the menu in Illustrator (File > Scripts)?
It's quite a work to access to scripts by "File > Scripts > Other script" every time, so I figure there must be some easier way out there.
View 3 Replies
View Related
Feb 7, 2012
We have over 50 artboards in most of our documents. Is there a way to sort the artboards as listed in the artboards panel by name via script?
View 13 Replies
View Related
Sep 2, 2008
How do I terminate the script - not Adobe application(s)?
exit(), quit()... - they don't work.
The only workaround I can think of is a main() function with "returns" in appropriate places, but I am just curious if there is a terminating command.
View 5 Replies
View Related
May 13, 2012
I want to make a tab in a radiotext and it does not work when i just add a tab.
I can add a space and other characters using unicode but i cant make it work with the tab character!
staticText = Grp1.add("statictext",undefined,"What? "); // Does not work
staticText2 = Grp1.add("statictext",undefined,"What?u00A0"); // Works but this is a space character
staticText3 = Grp1.add("statictext",undefined,"What?u0009"); // Does not work with Tab character
View 1 Replies
View Related
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
View Related
Mar 8, 2012
How to export TIFF from Illustrator using Javascript. I could not find TIFF export type in Illustartor export type.
View 4 Replies
View Related