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

ungroup all groups on an active layer(JavaScript).

$
0
0

Does anyone know how one would go about ungrouping all groups on an active layer with JavaScript?


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

Batching In Illustrator??

$
0
0

In PhotoShop CS3, you can select File/Automate/Batch, and run an Action on an entire folder.  I don't see that option in Illustrator CS3?  Is there a way to run an action on an entire folder?

 

I'm attempting to save many EPS images as PNG images, and would really like to retain "vector attributes" - is any of this possible???

 

Thanks for any help.

How to add text in .ai file and set position, font, size and colour

$
0
0

I want to place multiple lines of of text (individually) into .ai file and set size, font, colour and position for each.

Preferably text should have origin in a single point (rather than be framed)

 

Hope anyone can help me out.

 

Thank you in advance.

[JS]: Accessing Menu Items in CS6

$
0
0

Hi,

 

So I just got CS6, and I'm wondering how I access menu items using Javascript?

Also, I'm looking at the CS6 JS reference, and it doesn't say whether app.activeDocument.selection is Read-Only. Hopefully not, because I would need this for my purposes in accessing the menu.

The item I wanna access is Select > Same > Stroke Color. Seems simple enough. Any help would be appreciated!

Script for Selecting Open Paths in Illustrator CS6

$
0
0

I have created this script for selecting open paths in illustrator cs6 as the graffix plugin is not working under CS6.

 

Just save the following text in /Applications/Adobe Illustrator CS6/Presets/en_US/Scripts/Select Open Paths.js

 

 

if (documents.length > 0 && activeDocument.pathItems.length > 0){
 
          var allPaths = activeDocument.pathItems;
          var allPathsCount = allPaths.length;
          var openPathsAreLocked = false;
          var lockedOpenPaths = 0;
          var locked = false;
          for (var i=0; i < allPathsCount; i++){
                    allPaths[ i ].selected = false;
 
                    if( ! allPaths[ i ].closed){
 
                              try{
                                        allPaths[ i ].selected = true;
                              } catch (e) {
                                        openPathsAreLocked = true;
                                        lockedOpenPaths++;
                              }
 
                    }
          }
          if (openPathsAreLocked) alert (lockedOpenPaths + " open paths are locked or hidden (or their layer is locked or hidden) and cannot be selected");
}

How can I resize image

$
0
0
as vector.

C#

public string GetEPSView(string EPSFileName, int iWidth, int iHeight, string path)
{
string result = EPSFileName.Replace(".eps", ".gif");

appIll.Open(System.Configuration.ConfigurationSettings.AppSettings["TmpFolder"] + EPSFileName, Illustrator.AiDocumentColorSpace.aiDocumentCMYKColor, openOptions);

Illustrator.Document curDok = appIll.ActiveDocument;
Illustrator.ExportOptionsGIF gifOptions = new Illustrator.ExportOptionsGIF();
gifOptions.AntiAliasing = true;
gifOptions.Transparency = true;
gifOptions.Matte = false;
gifOptions.ColorCount = 255;

Double dScale = 100;
if (iHeight > iWidth)
dScale = Math.Round(iWidth / curDok.Width * 100);
else
dScale = Math.Round(iHeight / curDok.Height * 100);

curDok.Export(System.Configuration.ConfigurationSettings.AppSettings["TmpFolder"] + result, Illustrator.AiExportType.aiGIF, gifOptions);

if (!File.Exists(System.Configuration.ConfigurationSettings.AppSettings["TmpFolder"] + result))
result = "Error";

curDok.Close(Illustrator.AiSaveOptions.aiDoNotSaveChanges);

return result;
}

but how can I establish new size of image and as vector graphics?

get position of selected object

$
0
0

is there a way to get position of any selected object? It seems like normally you have to dive into specific item like textFrames to get position, but was curious if there was a generic way of doing this for selected objects.


Is it possible to script with Photoshop without explicit BridgeTalk use?

$
0
0

Not sure if I'm just "doing it wrong", but let me try to explain.

 

I know the usual "BridgeTalk.send()" process for sending messages to another application. What I'd like to do is join the scripts that I use for the different applications and have the process initiated from one, without having to use "eval()"'d scripts.

 

When my #target is "illustrator" the app object refers to the Illustrator object. The "photoshop" object within Illustrator is not the same as the "Application" object that would be available if the #target was something else. Is it possible to do this?

 

Simply put, with Photoshop and Illustrator open, I want to use a script ran from Illustrator to affect Photoshop without using the "eval()" method (and BridgeTalk.send() -- which is still just an "eval()"'d body.)

 

Thanks!

 

Edit: Not sure if it's hindsight or just a moment of clarity. I see there's a Application.doAction() method, is there one for running a specific script? That might be a better way to accomplish what I want to do.

Resize around custom point

$
0
0

Hi!

 

I wish to resize a selection around a custom 2D point. I have had a look at the resize function:

#target illustrator

sel = app.activeDocument.selection[0];

var scale = 200;
var scaleAbout = Transformation.TOPLEFT;

sel.resize(
    scale , // x number (double)    scale , // y number (double)    true, // changePositions bool    true, // changeFillPatterns bool    true, // changeFillGradients bool    true, // changeStrokePattern bool    scale , // changeLineWidths  number (double)    scaleAbout); // scaleAbout Transformation constant

Which works allright but I assume that I need to use the constants defined in the Transformation class? I cannot just input a 2D point to scale around? Would be handy.

I have a feeling that I need to use a transformation matrix to do this. Have any one a working example of how to do this?

 

Thank you,

 

Best Regards,

Johan

Batch creation of variables

$
0
0

A client works with CS4 on a map with about 2000 text boxes that need to be exported for translation.

 

Is there a way to batch process the file so that all the text boxes are assigned a variable for export in XML ?

 

Thank you in advance for the replies.

 

Jean-Christophe Helary

manipulate stacking order (e. g. bring element to front)

$
0
0

Hi,

 

is there a possibility to bring a named and thus selectable element of a drawing to front programmatically?

A Question on your CS6 documentation?

$
0
0

Hey AI (CS6),

 

I am referring  your documentation Adobe Illustrator CS6 Scripting Guide(PDF, 788k) English at your site:

 

In Page 22: You have mentioned as follows:

“CreateObjectlaunches Illustrator as an invisible application if it is not already running. If Illustrator is

launched as an invisible application you must manually activate the application to make it visible:”

 

I tried in my VB script (also VB.NET) Program creating the application object as CreateObject("Illustrator.Application.CS6"), during this step its creating the application object and also launching the Illustrator application (or IDE) in visible, which is contradicting your documentation above in green. Is there any setting I need to perform in Registry.

 

BTW: You also have wrong hyperlink/url  for the French version (instead of CS6 you CS5)  Adobe Illustrator CS6 Scripting Guide(PDF, 793k) French. This is very basic thing to double check when you bring a product in to the market part of supporting, I don’t know how guys could neglect like this

 

How can I start Illustrator visible?

$
0
0

Hello,

 

I want to start Illustrator and load a file on Windows environment by executing a Java-Script with the windows Scripting Host. The content of the Java-Script file is like:

 

var illustrator = new ActiveXObject("Illustrator.Application");

illustrator.open("c:\\temp\\1.pdf");

 

Illustrator starts, I see the Splash-Screen but after that no window of Illustrator appears while Illustrator is shown running in the task manager.

 

Similar calls to InDesign and Photoshop work well. The programs are started and shown on the screen.

 

Is there a possibility to get it running, without a Shell-Exec?

 

Thank you in advance

resize method with Javascript in Illustrator CS4

$
0
0

var objectBounds = docRef.visibleBounds;

var W = objectBounds[2] - objectBounds[0];//figures the width

var H = objectBounds[1] - objectBounds[3];//figures the height

 

 

 

// W & H are reporting the size in points ... convert to picas

var picaW = W / 12;

var picaH = H / 12;

 

// do the math for the correct column width: settings / width = percentage in decimal; multiply by 100 to get the decimal place in the right spot.

var endWidth

var percentageX = Math.round((endWidth / picaW) * 100);

 

var percentageY = percentageX;

 

 

for (var a=0; a<docRef.layers.length; a++){

 

     var layerRef = docRef.layers[a];

 

     layerRef.hasSelectedArtwork=true;   // select all

 

 

     // now to resize based on the percentage

 

     layerRef.pageItem.resize(percentageX, percentageY);

 

}

 

The width and height are coming out fine. But in this last line, that resize is just not working. When I run it I get an error that says: undefined is not an object.

The syntax must be wrong ... any ideas?

Thanks in advance!


Making the artboard that is farthest to the right the active artboard

$
0
0

Hello everyone! I am trying to figure out if it is possible to make the artboard that is farthest to the right in a document the active artboard. The artboards unfortunately are made in a random order otherwise I would just select the last one that was made. Thanks in advance!

Access Separations Preview Panel

$
0
0

Hi Forum,

 

Im new to illustrator scripting.

 

Would anybody help me to access "Separations preview panel"  through script.

 

thanks.

 

looking forward for your fabulous support on my request.

 

 

thanks.

How do I get the position of the selected PathItem in pixels ?

$
0
0

Hi,

 

I have a simple problem, but can't seem to find my way around it:

 

I have PathItem and Illustrator points out that it is at position (781px,250px).

How can I get those values in jsx ?

 

I've noticed that the PathItem inherits the position property from PageItem, and position

is a point, but when I try prining the values, I get undefined:

 

$.writeln(app.activeDocument.selection[0].position.x);

 

If I leave out .x from the line above I get this printed in the console:

 

521,510

 

What are these values ? Are they x,y coordinates ? In what unit ? How can I convert to pixels ?

Why can I not access x,y/top,left properties (always get undefined) ?

 

I'm using Illustrator CS5.

#targetengine

$
0
0

can anyone explain, what happened to "#targetengine session" in CC?

 

nevermind, seem like everything is persistent by now (just try to run the script couple of times).

 

 

#target illustrator
#targetengine main

if (isNaN(foo)) var foo = 32;

foo += 2;
alert(foo);

changing registration point?

$
0
0

I have a libraray of symbols for use in flash, but unfortunately some have center registration point and some have top-left.

I thought about

- copying symbol to document

- rename symbol

+ break link

- create new symbol from the instance (where I can specify registration)

- remove instance and old symbol

All of tthe - item work as expected. Is there any script to achieve the "break link to symbol" functionality

 

... or could you imagine an entirely different way to do that?

Viewing all 12845 articles
Browse latest View live


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