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.
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:
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):
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.
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.
Automated AI so much so that it can read instructions from an external source like xml or txt and automatically creates files and folders.
For example we have something like this: File1 Hello Font: Myriad Size: 22 Colour: Pantone 254C Image 1.jpg (link) Source: Image1.png (link) clipart1.eps (link) ---------- File2
and so on.
I want AI CS5 to: 1. create an eps File1, create a folder named File1, put File1.eps in it 2. type the text Hello, apply Myriad 22pt and PMS 254 to it, centre it to the artboard 3. Place all jpegs, pngs, eps source files on the artboard and embed them. 4. Save the file as eps legacy version 10, close the file and move to the next file.
I have about 500 files that I need to change one line of text in. Example. File name is XXX 001, the line of text is the file name so it would read XXX 001. XXX 002... etc. up to XXX 500. Is there a way that I could automate it opening, changing this line of text, saving and closing?
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.
I was wondering if there was a way to extract data from Excel to be used in Illustrator. I know there is an option of variables and xml, and I don't want that. I've seen and tried out how to read illustrator and write to excel, and I get that. What I would like to do is pretty much the opposite:
1.Pre-fill in an Excel file(.xls,.csv, doesn't matter) with data such as a filename in column 1 and (Replacement Text) in column 2 and close manually.
2. Run script(VBSCRIPT,Javascript, doesn't matter)
3.For each column in Excel file where cell in first column is not empty, open Illustrator Template with placeholder of "DWG" textframe and replace the frame titled "DWG" with Replacement text from Excel in Column2.
4, Save each to a PDF file and name file with text from Excel Column1(Filename)
In a nutshell, there will be a single illustrator template with a premade textFrame with a name of "DWG". Excel will contain two columns, one for the filename to be named and one for the relative text to replace with the placeholder in AI.
I want to send the contents of A1 to an Illustrator document at 135, 172 and B1 to 135,190, same with A2/B2 will be at different coordinates as will A3/B3 and so on... I want to do this 6 times and save the document as a PDF. Then, it should clear and do it again. The columns will ALWAYS be A and B.
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!
I am working on a project which needs..Text frames to be converted as flash text >property changed to dynamic text > writing instance name “_txt”.so how can i write scripting on above process.
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?
when I transform my edit into an after effects composition from the premier timeline the text layers all come over as black solids and the text content is lost.
I don't give two hoots as to your no doubt legitimate technical reasons for this, but the bottom line is that it sucks, it's a waste of my time and effort and it just seems like a simple thing that you should have implemented from the ground up when building the dynamic linking between AE and PR.
Is there an expected timeframe for the issue to be addressed?
Just to explain my typical workflow a little, I'm an editor/motion artist, so it's very frequent I'll lay out all my picture assets and text objects on a video edit timeline alongside vo and music, and once I'm happy with the flow I move the timeline over to Ae to commence animation for tv commercials, political spots, advocacy work, whatever.
I'm using Illustrator CS6. I have an artboard with 200 of the same placed file. I now want to use this same layout for 30 other views, they are the same size, but different images. If I relink them I have to click through each one. I tried using a script I found on here by Carlos:
#target Illustrator // script.name = relinkAllSelected.jsx; // script.description = relinks all selected placed images at once; // script.required = select at least one linked image before running; // script.parent = CarlosCanto // 7/12/11; // script.elegant = false;
I'm on a mac, os x 10.6.8. and I copied the script into the script preset folder so its starting from the drop down menu. Don't think I'm leaving anything out. I'm swapping 1 placed(linked) PDF for another.
There is no way to export PNG-files with a higher PPI than 72. I saw a thread that you could scale the pictures when exporting then script to open Photoshop and resize them? This is the last step in my big script and if i cant get this to work i cant use it.
I found a script that does the job, export tones of ai files to pdf, but I have some files which are in sub folders, and I was trying to find a way to modify this script to include subfolder, but no luck.
Adobe permits you to use, modify, and distribute this file in accordance with the termsof the Adobe license agreement accompanying it. if you have received this file from a source other than Adobe, then your use, modification,or distribution of it requires the prior written permission of Adobe.
This sample gets files specified by the user from the selected folder and batch processes them and saves them as PDFs.
Edits by Patrick Mineault: - only .ai files processed - files saved in same folder as the input files - export files have name (oldname).pdf - PDF settings: editable / acrobatLayers=true for maximum compatibility with Preview
// Main Code [Execution of script begins here] // uncomment to suppress Illustrator warning dialogs // app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS; var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, pdfSaveOpts; // Select the source folder. sourceFolder = Folder.selectDialog( 'Select the folder with Illustrator .ai files you want to convert to PDF'); [code]...
Is there a way to open a file as a layer? I want to open multiple files in the same window to make a collage. Currently, as I open each file they all open in separate windows. The "Open Document As Tabs" option in the User Interface preferences is not selected.
I'm writing a Javascript to run at startup. I want to check for the existence of XML files and process them, if they are available. How can I check for their existence?
i am creating a logo for a friend. I have an image that I drew, made transparent and then 3d. I want to save it as a pdf or jpg or png and when I try it, it eliminates the transparency effect.
Below is what it looks like when saved in PDF and any other format.
It is supposed to change hyphens to en-dashes in a ai files in a folder. However, when I run it, it only works on one file. After it makes the change and closes the first file, it stops.
var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, pdfSaveOpts; sourceFolder = Folder.selectDialog; if ( sourceFolder != null ) { files = new Array(); fileType = "*.ai"; files = sourceFolder.getFiles( fileType ); if ( files.length > 0 ) [code]....
I recently found the following jsx script, which saves a multi-layered IL file into 1-layer-per-file with PNG format.
This file is very useful, but i'm currently working on a project that requires the files to be saved into SVG format.
Is there anyway to edit this script to save the files as SVG instead of PNG?
// *** Export Layers as PNG files (in multiple resolutions) *** // // Version: 1.0 (29 Aug 2012) // Copyright Arcticmill 2012 // www.arcticmill.com // Developed by: Johan Otterud // // This script will export all layers that have a name starting with "#", or "%" into a subfolder of the current .ai document. // These options can be configured below: // *** Config options *** var subFolderName = "Export";
[Code]...
Remember that you must add a "" + exportLayersStartingWith + "" (when exporting the layer cropped to it's bound) or "" + exportLayersWithArtboardClippingStartingWith + "" (when layer should be clipped to artboard) to the beginning of the layer name. Also make sure that they layers you want to export are not locked or hidden.");
} else { // Show a completed message alert(layersToExportCount + " layer(s) was successfully exported to: " + exportDirectoryPath); }
I have about 300+ product labels that are in Illustrator, and some of them have an incorrect rich black color swatch. What I have been doing is going through and changing the color pallette to change them manually. Essentially going to the instance of black and changing them to regular black.
Is there any sort of script that can do this? The files are in CMYK.
Otherwise I have a lot of monotonous file editing to do.
I need to find a way to convert a LOT of ai files, individually, to low res pdf's. Preferably with the presets I want, not some defaults. I'm not interested in an action. I was hoping for a droplet, script, or something similar.
I did find this and it looked promising... [URL] ....
That almost worked. Ultimately, for some reason, it couldn't see the ai files sitting in the specified folder.