Illustrator Scripting :: User To Select A Font Family From A Drop Down List

Mar 25, 2013

I'm building a script that will open a dialog box allowing the user to select a font family from a drop down list (not a list of all of the fonts), and then compare that value against the fonts that are in use, highlighting everything that doesn't match. I have not yet built the dialog, but I've got  everything else working as I want except the list of font families.
 
The following code loops through the list of fonts (only 20 for testing purposes), compares the family name to the previous on the list (error trapped for the first loop), and pushes the family name (if it doesn't match the previous) into an array which will be used in the dialog box. With the two alerts at the bottom (for troubleshooting), I expect the alerts to show the same family name. For the first three fonts they do, but after that the array value is "undefined." 
 
var iCount = 20;
//var iCount = textFonts.length;
var nameHolder = "";
var nameArray = new Array();
 
[Code]...
 
Questions:

1) Any speculation on why this behavior is happening (it isn't truetype versus opentype)?
2) Is there a better way to get the list of font families without duplicates??
2) Is an array the best way to populate a dropdown list in a JS dialog box??? [this will be my first dialog with a dropdown, the others have user-typed values]
 
EDIT: Additional Info
When it reaches the ninth font in the list, the above script starts writing undefined, but when tested manually, as below, it works fine. Hmmm.
 
alert (textFonts[9].family);
var nameArray = new Array();
nameArray.push(textFonts[9].family);
alert (nameArray[0]);
 
EDIT: More info
tried replacing nameArray.push(familyName); with nameArray.splice(i,0,familyName); bad behavior remains

View 4 Replies


ADVERTISEMENT

Illustrator Scripting :: CS4 - Populating A Drop Down With List Of Printers?

Mar 27, 2012

I'm trying to populate a drop down field with the list of available printers. Here's what I have:
 
var printerList = app.printerList;
var w = new Window ("dialog");
w.orientation = 'row';
var dropDown = w.add("statictext", undefined, "Please select the printer");
var dropDown = w.add ("dropdownlist", undefined, printerList);
dropDown.selection = 0;
var buttonGroup = w.add ("group");
buttonGroup.add ("button", undefined, "OK");
w.center();
w.show();

This will populate a drop down with "Printer, Printer, Printer, Printer" for each printer instead of the name of the printer (which is what I want).
 
When I try:
 
var printerList = app.printerList.name;
 
I get a drop down of blank entries.
 
How exactly does the printerList work?

View 8 Replies View Related

Photoshop Elements :: Text / Font Family - How To Get Drop Down Menu To Work

Jan 17, 2013

I can't change the text fonts in Elements 9.  Most everything else seems to work except the font family drop down menu.  When I click on the arrow, the menu drops but immediately dissappears.  The font size drop down works but not the family menu.

View 5 Replies View Related

Photoshop :: Larger Font Preview In Drop Down List CS6

Jun 9, 2012

where the setting for the size of type/font preview drop down is located in CS6, it used to be located under pref->type->type preview - but apparently not anymore. I'm probably "blind", they surely did include this option in CS6?
 
(A thing I find annoying in CS6 is how short the font drop down list is, only covers 1/3 of the height of my resolution, even though I have hundreds of fonts activated - requires a lot of scrolling! I really hope this gets larger if it is possible to have larger previews)

View 3 Replies View Related

Illustrator :: Add Agenda Font Family To Mac

Oct 4, 2013

I am trying to add Agenda font family to my mac via users>username>Library>Fonts but still Illustrator says these fonts are missing when I open up the document? I've added the .otf files

View 3 Replies View Related

Illustrator Scripting :: How To Get User Input Via Prompt

Oct 3, 2013

I have this working without the prompt, if I under manually the margin via var margin = 10; it works. it also seems to return correctly when I print what the input from the user is, but it doesn't seem to want to work and freezes.
 
it says "point value expected"
 
//Helper functions
function print(i) {
    if(i == "object"){
        print("you are trying to printObject, use printObj(); function");
    }
    else { 
        $.write(i+"
[code]...

View 1 Replies View Related

Illustrator SDK :: Prompt User To Select Art?

Feb 21, 2012

Is there a method available to have the plugin pause and wait for a user to click some object, then continue? Or does all user interaction have to happen before/after the plugin is run?

View 2 Replies View Related

Illustrator :: CS6 - Change Font Size Of Labels In AI User Interface?

Oct 8, 2012

I find the default interface in CS6 difficult to read as the menu/tool labels seem very small to me. I can manipulate via Windows, but then the fonts in the windows of all my other apps are too big.
 
Is there a way to change the size of the fonts in labels in the user interface within Illustrator itself? I thought there used to be a way in preferences some where, but that was a long time ago - maybe even pre-CS?

View 1 Replies View Related

Illustrator Scripting :: How To Get Saved Selection List In JavaScript

Aug 21, 2012

Recently I met a little problem about save selection. I want to get saved selection list so that I can used in javascript. Some useful information about how to get Saved Selection list in javascript!

View 2 Replies View Related

Illustrator Scripting :: Hide Layers Based On List?

Apr 8, 2011

I have a very complex graphic with many elements and I would like to find a way to hide layers based on a list.  In the documentation that there is a way to tell if a layer is hidden, but didn't see anything about a way to actually to control the hide/unhide property.  Is this possible?

View 15 Replies View Related

Illustrator Scripting :: Select All Except Locked Object?

Aug 9, 2013

i want to select all the object , but i locked certain object it show error while submiting below code
 
myDoc = app.activeDocument;
myPageItems = myDoc.pageItems;
for (i=0;i<myPageItems.length;i++)
{
myPageItems[i].selected = true;   

 
modify above code to select all objects except locked object or i want to select objects outside active artboard

View 4 Replies View Related

Illustrator Scripting :: How To Select 2 Paths With Action

Jul 17, 2013

I need to create an action. A simple one. The idea: One path is selected, a user runs the action, it makes a copy of that path, moves the copy, select both the path and its copy and makes a blend.
 
I tried to record that action, but Illustrator does not record the paths selection/selecting.
 
Even a simplier task: How, in general, having one path selected, select an item/path above or below it? And how to select them both?
 
I can make a script for that, but the requirement is to keep it as simple as possible: have an Action only without any scripts, if possible.

View 2 Replies View Related

Illustrator Scripting :: Resizing Font Size Automatically?

Mar 24, 2011

how to auto fit overset text in a fixed text frame?
 
I import many languages into fixed text frames and it is a pain to keep resizing or scaling manually.
 
As of yet I've been unable to source any javascript or applescript that can do it. The closest has been "JET_AutoFitVertical.jsx" but this resizes the text frames.

View 4 Replies View Related

Illustrator :: How To Prompt User To Select Multiple Files In File Dialog Using Scripts

Oct 5, 2013

Is there a way to allow user to select multiple files inside the file dialog using scripts? So not just something like "*.ai" or "*.eps" but where the user can actually use their shift key to select a batch of files inside the file dialog and then the script would process each one.

View 3 Replies View Related

Illustrator Scripting :: Select Objects Outside Artboard Using JavaScript

Aug 10, 2013

I want to select the objects outside artboard using javascript. Their are many objects outside activeartboard i want to select all those object using script.

View 1 Replies View Related

Illustrator Scripting :: Select Only Objects Within Selection Marquee

Sep 17, 2012

I am trying to find out if there is a way to select only the objects within a selection marquee? In AutoCAD you can make a selection window from left to right and only those objects entirely within the window are selected. If you window from right to left all objects that are "crossed" or touched by the window are selected. Is there a similar technique in Illustrator?
 
Currently I have to select the objects, then go back and hold the shift key to deselect the object I don't want, or put objects on different layers then lock layers to prevent extra objects getting selected.
 
In AutoCAD, my primary program, you simply draw a selection window, left or right, depending on what your next step would be. No special tools or toggles or thinking ahead, it's just the primary selection process and very intuitive.

View 4 Replies View Related

Illustrator Scripting :: Select All On Artboard And Copy To Clipboard VBA

Apr 7, 2012

Is there a way to select everything on the artboard and copy it to the clipboard using VBA?

View 3 Replies View Related

Illustrator Scripting :: Select Same Fill And Stroke Color

Aug 8, 2013

Select same fill color with java script and stroke color tool.

View 1 Replies View Related

Illustrator Scripting :: Any Way To Select TextFrames That Only Have A Fill Color

Mar 11, 2013

I have a script that will select text Frames, but I have come into a situation where I need to exclude any text frames that do not have a fill color. I do not see a filled Boolean property for character attributes or text Frames. 
 
This is what I used to select all text on all visible and unlocked layers. I dont see a way to exclude textframes that have no fillcolor.
 
if (app.documents.length > 0 ) { 
var doc = app.activeDocument;   
var numTextFrames = 0;   
for (  i = 0; i < doc.textFrames.length; i++ ) {
try { 
textArtRange = doc.textFrames[i];
textArtRange.selected = true;
} catch (e) {}        }    }

View 6 Replies View Related

Illustrator Scripting :: Select All Objects Infront Of Or Behind Object?

Feb 23, 2012

I'd like to select an object and have a script select all objects behind that object, within that objects bounds.  I believe this is possible with z-order?  But I've never worked with Z-orders before

View 5 Replies View Related

Illustrator Scripting :: Select ALL Objects Directly Below Object?

Feb 21, 2014

Is there a way to simply select all object directly below an objects?
 
I found this script here but it doesn't seem to work.  
 
//DESCRIPTION:Select Below
// A Jongware Script
if (app.documents.length && app.selection.length)
{
ypos = app.selection[0].visibleBounds[3];

[Code] .....  

Here's an example file. I'm trying to select eveything below the yellow polygon.
 
This would be very useful in another project with many small objects bunch together below many larger objects. I want to group the small objects that are bellow the larger object together without having to manually select each objects (there are thousands of objects so a script would be ideal).

View 1 Replies View Related

Illustrator Scripting :: Select Items On Multiple Artboard

Sep 27, 2013

I have script where I select items on multiple artboard but I can't seem to get get active art board of the selected item. Is this possible?
 
each artboard has a text item and I would like them in the same position on each of their own artboards that they are already one. right now it adjusts them all to one artboard. here is what I have so far
 
doc = app.activeDocument;
for(i = 0; i < selection.length; i++){
    var firstItemPosition = doc.selection[0].position;
    doc.selection[i].position = firstItemPosition;
    var activeArtboardIndex = doc.artboards.getActiveArtboardIndex();
    alert(activeArtboardIndex);
}

View 10 Replies View Related

Illustrator :: Installed New Font - No Sample / Name In List - CS6

Sep 6, 2013

after installing new fonts I downloaded, I cannot get a sample, or even the name listed, of the font in the character panel of any of the new fonts.  All the previously installed fonts show up fine.  The new fonts have samples in Photoshop, Microsoft Word, etc, just not in Illustrator.  Is there some way I can change this in Illustrator?

View 2 Replies View Related

Illustrator :: 5.5 Crashes When Scrolling Through Font List

Aug 4, 2012

I'm running on a macbook pro OS 10.7.4 and illustrator 5.5 crashes everytime I open a new document, select the type tool and scroll through the font list from the font menu list. It scrolls about 25% down the list then crashes the software.

View 27 Replies View Related

Illustrator Scripting :: Text Overflow By Adapting The Font Size

Jun 2, 2012

I saw scripts that adapt a box to the amount of text, but i'am looking for a script that does it the other way around. I have a amount of text that has to fit in a predefined box for example 50 x 30 mm.
 
The script has to solve the text overflow issue by adapting the fontsize. Is this possible?

View 3 Replies View Related

Illustrator Scripting :: Round Font Size If In Decimal With AppleScript?

Dec 4, 2013

Is it possible to automate the rounding of font sizes if they are in decimal form? I have a few thousand files I have to prepare for upload and they can't have font sizes such as 8.214 which several do. With AppleScript would it be possible to identify and then round up or down such font sizes?

View 2 Replies View Related

Illustrator Scripting :: Select All The Objects In Active Artboard Using JavaScript

Aug 7, 2013

i want to select all the objects in active artboard using javascript

View 5 Replies View Related

Illustrator Scripting :: Select All Items In Document Based On SpotColor?

Jun 28, 2012

I'm trying to select every object with the color "CutContour" So far I've been trying:
 
myDoc.selection = myDoc.spots.getByName("CutContour"); I guess this obviouslly wouldn't work though because myDoc.selection is looking for an array of objects. However, I can't figure out how to loop through all the objects in the document and check to see if they contain the SpotColor.
 
I want to use the Select > Same > Stroke Color , but I heard that using that in Javascript isn't available unless you have CS6 (which I currently don't). Is it true that accessing menu items through scripting is a feature in CS6?

View 4 Replies View Related

Illustrator Scripting :: How To Select And Copy To Clipboard A Path On Layer

Feb 7, 2012

how the Photoshop DOM works with this snippet but I can't get it to select a pathItem correctly. When testing in ESTK I sometime have to run a line to that sets the path Item selected property to true several times before the path is selected in the GUI.Here is the script I am working on.

copyPathsToPhotoshop()
function copyPathsToPhotoshop(){
    var currentLayer = app.activeDocument.activeLayer;
    var count = currentLayer.pathItems.length;
    var shapeNumber = 105
    for( var p=1;p<count;p++){
 [code]....

View 12 Replies View Related

Illustrator Scripting :: Select All Paths Of Specific Color In One Document

Jan 7, 2009

I'm on Illy CS2, windows xp.

I want to open a doc, run a script that selects all paths of a color, say 255,0,0 or 50,0,20,4 and changes that color to black or another color I specify and also changes the stroke. Is this possible? I can't see how i would do it?

View 6 Replies View Related

Illustrator Scripting :: Select Objects That Fill Color In Document

Oct 14, 2013

If i want select objects that same fill color in document, I can use 'select - same - Fill color' function in Illustrator.
 
It's so fast. below 1 second.
 
But, If i want make it in Javascript, I can't do it like fast.
  
for(i=0; i<activeDocument.pathItems.length; i++){...}
  
If document have 10,000 objects, above script can't finish in even 60 seconds.
 
How Illustrator can traversal fast?
 
Is there something other way?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved