Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all 12845 articles
Browse latest View live

Place a circle wherever I click.

$
0
0

I'm new to scripting and I have a UI with a toggle button.  I want to place a circle where ever I click  (only when toggle is active)  Is this possible.


Script to make multiple layers in one task

$
0
0
From time to time I find the need to make many empty layers named A-Z. I use this when preparing a font drawn in Illustrator for moving to FontLab.

I have not found any ready made script to do this and would like a little help to make one. Or, if somebody would like to make this script it would be even more helpful.

The situation is this:
A full set of glyphs is ready in Illustrator and all are on Layer 1.
Artboard is set according to: http://font.is/?p=48
Glyphs are aligned to left on top of each other.
Need to make empty layers, A-Z and even more. Tedious by hand.
Then each glyph is moved from the sublayers to their own new layers. I could continue doing this part by hand.

I could of course make these layers in one file and copy them each time to each project but a script would be soooo much cooler.

Any help with this? Hints?

Thanks in advance.

Illustrator script that allows me to designate layers to export by layer name?

$
0
0

I am a fashion designer who works on a multi-artboard, multi-layer file for each garment design. I have set up the file so that each layer has particular info on it. For example, the layer called "Croquis" has my croquis body form that I draw over on it, the layer called "Front" has the front garment sketch on it, the layer called "Back" has the back sketch, and the layer called "Front_Spec" has the front garment sketch with design call-outs on it. I will have up to 30 of these files each season. From these files, I need to export the artwork on only some layers as png's. For example, I need to export the art from the layers "Front", "Front_Spec" and "Back" but not the layers "Croquis" or "Style Info". Is there a script that would allow me to do this, or one I might easily modify to do this? It's a real chore to go into each file, hide and unhide layers, and export artwork one by one.

 

Any assistance is much appreciated!

 

- erin

Convert .ai to .doc

$
0
0

Hi,

 

Can it be possible to convert .ai file into .doc file or any tool which will do this conversion.

 

Thanks,

Shail

CAN AN EXCEL XLSM FILE READ FROM A CSV AND WRITE BACK TO THE SAME XLSM -VBA

$
0
0

Hey Carlos- Here's the repost. 

 

Could an XLSM file read a line from a CSV file in "A1" and depending on what was in the first column in the XLSM, search the CSV file and find the indexed item in the second column or third? I've done it before with standard VLookup functions and it was cumbersome and very slow, and for some reason, everytime I would save the file it would take forever although the xls file was a single sheet.

 

i've attacthed a sketch of what I'm talking about, because it's hard to explain and I think the sketch explains it better. Here it is, sorry if it is blurry, it looked fine before I posted:

xlsm example.PNG

Move layers to new artboard

$
0
0

Hi everybody,

 

I'm trying to create a script via javascript for Illustrator.

 

My problem is :

I have a AI file with multiple layers, i want to create one artboard per layer, in order to export a multipage PDF ( each page contain 1 layer ).

 

The layers represents the differents type of print ( vernish, color, hot gold, pressure ... ) and/or color type ( Pantone, CMYK, cut, kisscut ... ).

My client want a PDF for see each type of print or color type per page.

 

I'm trying 2 ways :

 

1st solution : Create new artboards, and duplicate ( or move ) layers content on the new artboad, but the function move/duplicate don't work to move content on another artboard.

 

2nd solution : Create new document with the same number of layers as artboard and duplicate layer to the new artboard on the new document.

 

Can you help me to realize this script ?

 

Excuse me if my english is not good.

Acrobat

$
0
0

Hello everyone, I currently use the option to "preflight" the acrobat to check for errors in the files, you can make a script that opens a file. Ai in Acrobat and use the "preflight" I have set up to test the file, if possible could someone give me a starting point?

 

 

Thank you

Actions and extensions

$
0
0

Hi all

 

So here's my issue.

 

I have a project on illustrator, with multiple documents (or a single multipage doc) with a design and a different QRCode placed at the same place on all pages.

 

So I guessI need to create an action that will duplicate a page, and put a QRCode at the specific place, the list of links being provided by an external document (Excell, word, whatever).

So far, I have found an extension that will allow me to create those QRCodes.
But I didnt find how I could integrate the action of calling up the extension while recording the action script, and how to link it to the external document.

 

So if someone could tell me how, or what workflow I could use to achieve this goal it would be great.

 

Furthermore, I guess i will need to use the variables for the list of urls, and I dont know exactly how to use those yet. If someone could explain, or link to a good page where this would be explained I would appreciate.

Please feel free to ask for extra details if needed...

 

Best regards


Mail merge using illustrator

$
0
0

Hi There,

 

I'm trying to find a way to automatically populate data into Illustrator and InDesign.  I was thinking of doing it using Applescript and importing an excel file into an illustrator graph object.  My boss suggested i look into using Xtags as a means to do a data merge with the illustrator/indesign files.  Is this possible? it seems that xtag is a format used with Quark.  is it also available in Adobe products?

 

Thanks,

 

(sorry if my terminology is off, i'm a programmer so my knowledge of adobe design products is limited)

UI (Window, dialog, palette etc) reference info for AI scripting

$
0
0

I'm looking for standard reference info on UI elements like popup windows (dialogs, palettes etc). I've been through the Illustrator CS6 Javascript Scripting reference guide and also the CS6 Scripting guide, checking every mention of the words "Window", "Dialog", "Palette" etc (there aren't many), plus related terms like "edittext" and "slider" (which seemingly don't exist in these documents at all), and can't find what I'm looking for.

 

----------

 

I'm trying to script a simple info box that contains information generated by a script that doesn't need to be closed before the user continues working.

 

All I'm trying to find out is the basics. From looking at other scripts I've figured out that you can create a popup box like this:

 

var box = new Window('dialog', 'Some title');

var panel = box.add(panel, undefined, 'Panel title');
panel.add('edittext', undefined, 'Default value');
panel.add('slider', undefined, /*Default numeric value*/,/*min*/,/*max*/);

var group = box.add(group, undefined, 'Group title');
group = area_len_box.add('group', undefined, 'Title (not displayed)');
group.orientation='row';
group.closeBtn = group.add('button',undefined, 'Close', {name:'close'});
group.closeBtn.onClick = function(){
  box.hide();  return false;
}

...which is enough for a very rudimentary input system, but one which has to be closed before the user can return to their work - and I can't find any resource that gives the full options:

 

  • What are the other options for 'new Window'? I'm aware of 'palette' which appears to need an array of four co-ordinates like [20,20,100,100], but it clearly needs something else too as every palette I've made instantly closes. And what else is there beyond Window and Palette?
  • What other input devices are there beyond edittext and slider, and what parameters do they each need?
  • What can go in the "undefined"s I see everywhere these are used?
  • etc etc

 

There must be a reference to this somewhere, but I can't find it.

Save as FXG option not working from script. Am I doing this right?

$
0
0

I see that the Illustrator Scripting reference document for CC 2014 [1] has references to FXG, FXGSaveOptions, etc.  I thought I would give it a try to see if I can save a document to FXG.  Here is what I am trying:

 

var myDocument = app.documents[0];
var myTextFrame = myDocument.textFrames.add();
myTextFrame.position = [200,200];
myTextFrame.contents = "Hello World!"

var newFile = new File("c:/temp/fxgfile");
var fxgSaveOptions = new FXGSaveOptions();
myDocument.save(newFile,fxgSaveOptions);

 

This causes the file to get saved as fxgfile.ai and not fxgfile.fxg that I was looking for.

 

Any ideas?

 

Thanks,

Om

 

[1] http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/illustrator/sdk/CC2014/Illustrator% 20Scripting%20Reference%20-%20…

Changing decimal values to fractions

$
0
0

Does anyone know of a good way to convert decimal values to fractions for use in inch measurements? I have a script that works great but it returns values like 5.5638 and I'd rather it return the closest fraction answer like 5 9/16. 1/16ths would be great, but I'd settle for 1/8ths.

 

I started trying to come up with a large if with lots of > and < conditions, but I figured if anyone has already done this it might be better not to reinvent the wheel.

 

Thanks.

Shortcut for js script with CS4 ?

$
0
0

hi all,

with my old version of illustrator (CS), i might affect a shortcut to a specific scipt .

Now i have CS4 version, and i  don't find similar possibility.

 

how can affect in this new version ?

 

Thanks for futur answer.

Importing SVG in a script

$
0
0

I have some SVG files that I need to bring into illustrator via a script. The documentation doesn't even indicate that this is possible?

 

Can someone confirm this one way or the other?

script to put artboard names in text boxes

$
0
0

Hi there. I have an Illustrator document with ~100 artboards, each artboard named by me. Each artboard has one textbox in it. Is there a way to take whatever name I assign to the artboard and print it into the text box inside that artboard? So in the end I would be able to see the name associated with each artboard on the artboard itself. Ideally I could run the script once (i.e. "turn it on"), have it populate all the text boxes with the artboard names, and then have it dynamically update the textboxes when I change an artboard name regardless of whether the file has been closed and opened since I originally ran the script.

 

Maybe this is more of a plugin? Either way I don't have any idea how to approach the problem, nor much scripting experience (I've tried several times, but never succeeded! ).

 

Petros_


How do I batch replace 100 different linked images in my AI file and export 100 different named PDFs?

$
0
0

Hi all!

 

This is driving me crazy...

 

So I have my A4 AI document with a QR code at the bottom (don't ask why I'm using QR codes, client work) and need to replace it and export the A4 poster as a PDF. I need to do this 100 times with 100 different QR codes and save 100 PDFs.

 

To summarise I need to,

 

  1. Open A4 document (that has artwork already).
  2. Drop in QR code A near the bottom.
  3. Export as PDF A.

Repeat..

  1. Open main document.
  2. Drop in QR code B.
  3. Export as PDF B.

 

And so on x100....

 

I have a experience with actions in Photoshop but not batch actions or scripts, and obviously need to run it in Illustrator...

 

Can anyone help?

 

Thank you!

How to replace a text frame by a .ai file?

$
0
0

Hi,

I am writing an javascript Illustrator script opening an AI file, getting a text frame in the layers/pageItems by its content, then replacing it by a placedItem embedding another .ai file (a little shape).

I managed to get the pageItem and to create the placedItem in this way:

 

...
var item = mainGroupElement.pageItems[i];
if(item.contents == 'X') {  $.write("X found\n");  var walkingManFile = File("D:\\walking-man.ai");  var walkingManItem = mainGroupElement.placedItems.add();  walkingManItem.file = walkingManFile;  walkingManItem.embed();  var scaleX = item.width / walkingManItem.width * 100;  var scaleY = item.height / walkingManItem.height * 100;  walkingManItem.resize(scaleX, scaleY, true, false, false, false, 100, Transformation.CENTER);  var deltaX = item.position[0] - walkingManItem.position[0];  var deltaY = item.position[1] - walkingManItem.position[1];  walkingManItem.translate(deltaX, deltaY, true, false, false, false);  walkingManItem.trace();  item.remove();
}

 

'item' typename is TextFrame.

The shape "walkingMan" is well traced, but not translated and resized at all. However, the scaleX, scaleY, deltaX and deltaY values seem good.

Does anyone know what I'm doing wrong here?

I would appreciate any help on it!

How to divide all textFrames in one-character-per-textFrame?

$
0
0

Hello:

 

How to divide all textFrames in one-character-per-textFrame?

 

Example: the textFrame "Letters" will be divided in 7 textFrames: "L", "e", "t", "t", "e", "r", "s".

 

Help, please.

Is it possible to add an EventListener to the Illustrator Window?

$
0
0

I am trying to make an interactive palette that updates according to the selected art in illustrator.  Is it possible to add an EventListener to the illustrator window that could capture a change of selection, and update the panel? If this is not possible, does anyone have a work-around for this?

 

Thanks in advance.

All Group to Ungroup Script

Viewing all 12845 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>