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

Convert to Grayscale

$
0
0

Hello,

 

It is possible to apply the Convert to Grayscale(Edit->Edit Colors->Convert to Grayscale) for the selected items in illustrator cs3 in script (javascript)?

Kindly advice me the possiblities.

 

I'm a begginer I hope somebody help me

Thanks a lot

Florin


All Group to Ungroup Script

Applescript Save as PDF Error on 10.11

$
0
0

Hi,

 

I have an Applescript application that populates an Illustrator PDF with data and colours and then saves the document to the desktop as a PDF, named a certain way.

 

I have just upgraded to Mac OS 10.11 (El Capitan) and now the script errors on the save command everytime. It has previously worked on versions of Illustrator from CS2 to CC2015 and versions of OS from 10.5 - 10.10

 

tellapplication "Adobe Illustrator"

tellcurrent document

  setPDF_Destto ((path todesktop folder) asstring) & "test.pdf" astext

  saveinfile (PDF_Dest) aspdfwith options {class:PDF save options, preserve editability:true}

  endtell

end

 

The error is: an Illustrator error occurred: 1129270854 ('FNOC')

 

Is this a known bug? - I cannot find any other recent record of this error

Is there a way around it?

Could I just replace the command with Javascript? I know very little JS, do you have a code snippet that you can pass the destination file path to?

 

Thanks for any help

Ian

List missing fonts in Illustrator

$
0
0

Hi all,

 

I've been working on a script to try and build a list of font's that not loaded in Illustrator. I know that Illustrator will alert missing fonts when a document is opened but this routine will be part of a larger script that will have the user dialogs turned off. My process is to build a list of fonts that are available to the the application, then build a list of fonts that are used within the active document and cross reference them to see if there are document fonts that are not in the application fonts list.

 

I have used a great function that I believe was posted originally by Moluapple and with some some brilliant advice from the always helpful CarlosCanto I thought that I had found the soultion but it appears to have some limitations. If I get a list of fonts available to the application and the document that I want to cross reference them against is open, the list that's returned contains fonts that are used in the document. Then when I get a list of fonts used in the document and cross reference them they will all be in the application list regardless of whether they're loaded or not.

The only way that I can get accurate results are if I run the script without any documents open and build a list of application fonts, then open a document and build a list of document fonts and then cross reference. This is the only way I can find out what fonts aren't loaded.

 

Does anybody know of another way to build a list of missing fonts without having to close documents first? I have searched through the XMP data and this doesn't seem to give me any clues and I've tried writing the code in applescript but it appears to work in the same way. Any help or comments would be welcome.

 

Here's my code:

 

#target illustrator

 

 

var doclist = app.textFonts

 

 

var appFontList = new Array ();

for (i=0;i< app.textFonts.length; i++){

    var fontName = app.textFonts[i].name;

    appFontList[i] = fontName;

    }

 

 

var myfile = File.openDialog ('Choose a file');

app.open (myfile);

 

 

var docFontsList = getUsedFonts(activeDocument);

 

 

// function accredited to Moluapple

 

 

function getUsedFonts (doc ){

     var xmlString = new XML(doc.XMPString);

     fontsInfo = xmlString.descendants("stFnt:fontName");

     var ln = fontsInfo.length(), arr = [];

     for (var i = 0; i<ln; i++){arr.push(fontsInfo[i])};

     return arr;

}

 

 

var missingFontsList = checkFonts();

alert(missingFontsList);

 

 

function checkFonts(){

    var fontArray = new Array ();

    for (i=0; i < docFontsList.length; i++){

        var thisDocFont = docFontsList[i];

        var activeFont = false;

        for (j = 0; j < appFontList.length; j++){

            var thisAppFont = appFontList[j];

            if (thisDocFont == thisAppFont){

                activeFont = true;

                }

            }

        if (activeFont == false){

            fontArray.push (thisDocFont);

            }

        }

    return fontArray;

    }

 

 

Many Thanks,

Nik

set Illustrator window size applescript (or javascript)

$
0
0

Hello

I have an appleScript for setting the bounds of an InDesign window and tried to adapt it for Illustrator, but it won't work. Can anyone help with this? I have two scripts which work in InDesign:

 

Script 1:

tellapplication "Adobe InDesign CS6"

  activate

  tellactive window

  setboundsto {100, 1280, 1412, 2548}

  endtell

endtell



Script 2:

tellapplication "Adobe InDesign CS6"

  activate

  tellwindow 1

  setboundsofwindow 1 to {105, 8, 1417, 2548}

  endtell

endtell


Thx for any help



Looking for "Replace with Symbol" script

$
0
0

So I am trying to replace gps points with a symbol I have created. I have found blogs referencing a script that can replace selected items with symbols saved in the symbols panel, but I can't seem to find the actual script! If anyone knows where I can find JET_ReplaceWithSymbol.jsx or any other script that can do the same function, it would be greatly appreciated!

Multiple html5 extensions under a single menu item

$
0
0

is there a way to add a menu item to extensions to house multiple extensions under one umbrella name?

 

example:

Menu/ Window / Extensions/ Name / Extension 1

Menu/ Window / Extensions/ Name / Extension 2

 

i want to make a family of extensions under 1 parent name and not scattered about in the men bar.

Using JavaScript to create a 'database' of sorts from Illustrator

$
0
0

Happy Friday, fellow scripters!

 

I just had a thought regarding time tracking of orders within my department that I'd love to get your thoughts on. Up until now, my staff has used an excel template to log their time in/out for any particular job they're working on. In addition, for more colorful data, the excel spreadsheet includes columns regarding quantities of uniforms, art applications, and other variable data related to the job.

 

It's very time consuming for the artists to fill this out 20-30 times per day, and even more time consuming for me to combine everybody's separate spreadsheets into something that I can use to generate useful department wide data for the big boss.

 

The data I'd like to track:

User name

Start time

Order number

Customer name

Number of applications per garment (ie, front logo, player name, player number)

Type of garment (specific style number)

Finish time

 

All of this data with the exception of the user's name and start/finish time are built into the files they'll be using, so I can pull that info straight from the file itself without the need of prompting the artist for the information, and I'm hoping i can grab the user name from the system somehow, and start/finish times are easy enough to do with timestamps at runtime.

 

My question:

Is it possible (or even advisable) to get all of this information and write it to some sort of centralized JSON database file? Is it possible to use ESTK to write a .js file that I can then access and rewrite at a later time? If not, could I just write the JSON as a .txt file, then simply eval() when i want to read/rewrite info?

 

 

Has anyone done anything like this? Should i quit this foolish venture now because I'm young and naive? Any advice?

 

Thanks, all.


Convert .eps file to .jpg or .pdf

$
0
0
Hello,
I'm using Adobe to deal with .eps files.
My problem is to display graphic arts in "read only mode". That means when I'm done developing graphics in my .eps file, I want to display this graphics to other user without giving him option to edit it or delete it.
I'm trying to accomplish this true Visual Studio 2005, C# .net
Does somebody have any suggestions?

Exporting an .ai file to a bitmap file

$
0
0

In Illustrator Scripting (VBscripting), how can you export an ai file to a bitmap file?

 

In Illustrator you can open an ai file and by selecting the Export option you have a choice of formats and one of them is BMP.  How can this be done in scripting?  I did look at the AIExportType, but BMP is not in the list.

 

aiJPEG = 1

aiPhotoshop = 2

aiSVG = 3

aiPNG8 = 4

aiPNG24 = 5

aiGIF = 6

aiFlash = 7

aiAutoCAD = 8

 

I will also need to do this same method by Exporting to an eps file.

 

The task is the following:

 

When a client uploads an image file, we need to automatically export the file to bmp and to esp, thus having 3 files (original upload, bmp, and esp).  The file types that we are exporting, so far, will be ai, esp, and pdf (more to follow I am sure).

 

We also need to get information about each file.

Is it vector or a bitmap?

Color:  RGB, CMYK, or Pantone?

Is there text or curves or both?

What is the DPI resolution?

What is the image size?

 

Any help would be beneficial.

 

Thanks,

 

Tom

 

 

 

 

 

 

 

 

 

 

 

 

Missing Links

$
0
0

I'm trying to find a way to get the links and link statuses in Adobe Illustrator. It doesn't seem to be at all similar to InDesign DOM so I'm hoping somebody has done a similar thing before.

 

What I'd like to be able to do is check whether a file has a missing link. I have been able to trace it to a "placedItem" which is inherently a "pageItem". So is it possible to find the link status? Been going through the DOM for about a half hour now and still can't find it.

 

 

app.documents[0].placedItems[0]  <--- How to get link status?

 

Thanks!

Split Text into Layers

$
0
0

I was wondering if anyone is aware of a script that is able to do the same as this photoshop one http://www.agasyanc.ru/text-splitter, I would use that one in photoshop but its not working in CS6.

 

I  was hoping to find a script that will seperate the text into layers  ready for export to After Effects to be used in Kinetic Typography  pieces

 

thank you

FlashPlayer: Error FlashPlayer error 0x3: internal player error

$
0
0

When loading a SWF file into javascript: -

fp = Group2.add('FlashPlayer',{x:0,y:0,width:480,height:480});

flashFile = new File('C:/1.swf');

fp.loadMovie (flashFile); // playing

flashFile = new File('C:/2.swf');

fp.loadMovie (flashFile); // error

How to convert all groups to layers

$
0
0

Hello all,

 

I have a gigantic file with multiple groups containing each mutiple subgroups wich contain... you guessed it, many other groups.

 

I need to convert every single group of this file to a layer, and respect the same order (groups, subgroups and so on) to make this drawing usable and editable.

 

Unfortunately, I have zero skills in JS or programming.

 

Has anyone faced the same issue? I'm looking for a script that would create the layers, name them and move the content automatically to the appropriate layer. It would be just waaaayyy to long to do it manually because the file contains over 20,000 shapes (plus I have several other files that I need to convert the same way).

 

Any help would be very, very appreciated!

 

Thank you

Place 10k jpegs in 150 lots into AI as grid

$
0
0

I wonder if this is something scripting could solve as doesn't seem possible though the UI tools.... and keen to do this manually.

 

I have a total of 10,000 tiny (13*13mm) jpeg files ordered into separate folders of aprox 150 per folder (each folder varies). The contents of each folder is numbered in an numerical order which needs to be maintained (the files in each folder have a prefix unique to that folder)

 

I wish to place them, as a folder in one go, into AI (CS5.5) and  automatically arrange them as in a grid of 15 columns wide (the rows may vary with max 15).

 

Each AI file will have one art-board of four grids of 15*15. But I am fine creating each grid in separate files and manually c&p into art-boards as required, would be keen to automate the placing process in anyway so don't have to manually place each of the 10k files.

 

This needs to happen in AI (I know how to do this simply in InDesign, but this isn't suitable for the output which is a industrial/scientific printing process)

 

Thanks in advance.


All Group to Ungroup Script

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.

CS5 on Yosemite ESTK performance

script to align selected objects to artboard

$
0
0

Hello, I was wondering if anyone had a simple solution to aligning selected items to the artboard. I was going to create an action but then realized it would be more convenient for me to include it in my script file....I have a script to align objects with each other but they dont align to the artboard. Any suggestions?

Convert .eps file to .jpg or .pdf

$
0
0
Hello,
I'm using Adobe to deal with .eps files.
My problem is to display graphic arts in "read only mode". That means when I'm done developing graphics in my .eps file, I want to display this graphics to other user without giving him option to edit it or delete it.
I'm trying to accomplish this true Visual Studio 2005, C# .net
Does somebody have any suggestions?
Viewing all 12845 articles
Browse latest View live


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