Illustrator Scripting :: How To Set Character Attributes On A Range Of Characters At Once
Jan 11, 2014
Illustrator Version CS3-CC
Preferred scripting: Visual Basic (VBScript)
In the Adobe Illustrator CS5 Scripting Reference (VBScript), I see the following code for setting character attributes.
iCount = textRef.Characters.Count
i = 1
Dim charRef
Do While (i < (iCount + 1))
dSize = dSize * 1.1
textRef.TextRange.Characters(i).CharacterAttributes.HorizontalScale = dSize
textRef.TextRange.Characters(i).CharacterAttributes.VerticalScale = dSize
i = i + 1
Loop
Is there a way to set character attributes on a range of characters at once?
Iterating through the characters one by one is really slow, especially in higher versions of Illustrator (like CS6).
I want to be able to set character attributes, for example, from the third character to the sixth character of a paragraph textrange.
Basically, I want to do something like itembyrange in InDesign scripting.
Code snippet to show me how to iterate through the selected text (not the frame!, not the words, only the selected chars) and make any change on the characterAttributes (size, color, etc.)?
In the property "app.activeDocument.selection" usually the selected objects are stored as an array. Now when I select characters in a textframe (or TextPath, whatever) there is a [Textrange] in it. I already tried some combinations like this snippet underneath but I still get errors, that selectedChars[i] is undefined.I'm on Illustrator CS4, Mac OS X, Javascript
var selectedChars = app.activeDocument.selection.characters; for (i = 0; i < selectedChars.length; i++ ){ selectedChars[i].characterAttributes.fillColor = myNewCMYKColor;
I'm needing to loop through each character of a text frame and check the color of each character. Is it possible to get the swatch name of each character? Or can you only get the red, green, blue values?
I'm sending this message regarding this link : URL....Just need a favor with all my respect to you and i think you will not let me down asking u for 2 script to divide characters in the textbox like the following:
1st : (TEXT FRAME) : Each letter alone and delete the space character .. with out moving any character from it's position 2nd : (TEXT FRAME) : Each word alone and keep the space character
I use several scripts in Illustrator. Some of them I use in this way: [URL] ....
Now I tried to built in two other scripts in the palette. In this scripts it is required to use special characters in variables. Standalone these scripts are work correct. Here is an simple example:
// exampleScript.jsx var a = 'u201d'+" example "+'u201d'; alert(a)
I get this (correct) result:
But when I call this example script with bridge talk:
var scriptToLoad = new File(pathToScript + "/exampleScript.jsx"); var win = new Window('palette', 'own palette'); var btnSelect = win.add('button', undefined, 'example'); [Code] .....
I am quite conversant with Unicode keystrokes (Alt+XXXX) for most symbols in fact I have a cheat that aids me in the correct character code.If I don't have the code I just copy it from the character map and paste it into the sentence but it gets a little tiresome after a while searching the character map for symbols.
I have on numerous occasions lately had the need to to insert the 'THEREFORE' symbol (You know the 3 dots in a triangle) into text notes on my drawings.
This symbol only seems to have a code "U+2234"..I have spent a lot of time searching everywhere for a clue as to what this keystroke sequence means.
I have my font style set to "Arial Unicode MS". Looking for the correct keystroke sequence for "U+XXXX"?
Windows 7; Photoshop 13 (CS6).I am typing some text in a new layer; no problem so far. I need to insert some special characters that are not on the keyboard, e.g.TōkaiThat also was not a problem; I copied the character from the Windows Character Map.
Now I want to copy/paste more special characters from the Character Map, e.g. ☏ (U+260F) or ✉ (U+2709)
Now all of a sudden this does not work; the pasted characters appear in Photoshop as a boxed X.The font I have been using was Arial, but when I pasted these Unicode characters, the font automatically changed to Myriad Pro. Changing the font back to Arial does not alter the boxed X.
I took these Unicode characters from the Character Map using font Arial Unicode MS. That font does not appear in Photoshop.Questions:are there any Unicode fonts available in Photoshop?is there any other way to paste such characters into Photoshop?
I'm try to automate the importing of the Varaible and datasets into my graphs via Scripting, but the ImportVaraibles() function doesn't seem to work. Here is my Script, mostly copied from the example script provided with Illustrator (CS5). And, this works manually, using the file names in the script, via Load Variable Library
Set appRef = CreateObject(strIllistratorVersion)
'Open the file and import the datasets Set docRef = appRef.Open(strTemplate & "200-500.ai") 'docRef.Datasets.RemoveAll docRef.Variables("Yearbook").Delete
Here is the problem, after I delete the previous library, then this next line, right from the example, does nothing The script then exits with 'No Datasets in this document'
docRef.ImportVariables (strXMLFolder & "Lumber_200-500.xml") 'appRef.DoJavaScript "alert('Template:" & strTemplate & strRange & ".ai | XML file:" & strXMLFolder & "" & objFile.Name & "^')" If (appRef.Documents.Count > 0) Then Set docRef = appRef.Documents(1)
[Code]....
If I remove that delete line, the script runs, but just uses whatever Variables I had last loaded, not the XML file.
It's simply not loading. What do I need to do to get it to load?
The command provides a unique id for the selected text range.
I use that id (may be at later point of time, may be after close/reopen of file) and run another command that selects that range using id and performs some operations.
Questions:
Is textrange associated with a unique id? (I am guessing yes, atleast internally) How do I get this id? Will this id be consistent accross sessions? (even if I close and open the file does it remain same)
I am programmatically setting the text of selected text range from plugin. The text is obtained from external system. It is html formatted (ex: <b>bold</b> text and this is <i>italics</i>) . Is there a way to set the formatted text into text range? Currently it is showing the entire text including formatting tags as text.
I am working on a scanned black and white image that I image traced in Illustrator. I am now in the process of seperating certain parts of the image from each other for changing colors. I know how to do this, but my way is by using direct select and going in and picking out points and joining them which is going to take ages. Is there any way to say select a range of anchor points on a path (not the whole path, but not individual points either) like shift clicking a range of files in windows explorer? Are there any other ways I can go about this in a more time efficient manner? I am using the Creative Cloud.
I am working on a logo which has the word "E-Commerce" in it. I am using a font that works quite well for it but the dash is way too long, it's in fact longer than an m dash and the font doesn't have anything else.
Short of modifying the font file or turning it into outlines, is there a way I can just make that one character shorter? I seem to remember that in earlier versions of Illustrator you could set the font width but all I can see in the character pane in CS6 is kerning and tracking. I don't want to use the transform tool because it would stretch all the text inside the box.
Using the new caracter font scroll feature in CS6. When scrolling through fonts by highlighting in the carater box and watching my type change from font to font, it will come to a stop at certain fonts.
So I want to type in a column, so I went to type > type orientation. However, Each character is vertical. I want to type two characters on a line, then break to the next 'line', as I'm working on a calendar piece and I want all numbers to be aligned straight up and down.
I am exporting a table - save from Excel to PDF. Open in AI and export to EMF. The word 'Difficult' in one column comes out 'Dif cult' in every occurance. It worked with a different table one time last week but now happens with every table I attempt to export. I even went to an extra step of saving the PDF to AI and then exporting to EMF. Same results.
How do I type hebrew characters in a document. Is there an on-screen keyboard that I can use similar to how microsoft word does? I am using Illustrator CC.
I'm using Illustrator CS6 on a Mountain Lion Mac. Got a weird problem with one of my fonts. I'm used to type accented characters like é by typing option-e plus e. Which works so far. On one of my fonts however, EuroComic, when I want to type the é character and start with option-e, it already changes the font to Myriad Pro. Typing the e after that makes it é, but in Myriad Pro, not EuroComic. It has always worked before when I was still using Snow Leopard. And it's not a font problem I think, cause in Indesign that same way of using option-e plus e works. The é is at the correct spot in EuroComic cause when I select all text and change it to EuroComic (after having typed that é), not only does all text turn into EuroComic again, but also that now Myriad Pro é turns back to EuroComic é. What could it be that could make illustrator turn the font to Myriad Pro after typing option-e on that parcitular font? With other fonts like Arial etc.
Let's say I create a poster with a couple of blocks of text in Illustrator, using a single font. Then, I generate a PDF of the poster.
Now, on the same computer, I open the PDF in Illustrator, and Illustrator pops-up an alert saying some text has been outlined to preserve appearance. And, indeed, here and there throughout the text, some words, combination of words, or whole lines of text have been outlined, but most of the text is still live.
Why does this happen? There's no difference, font-wise, between the text that is untouched, and the text that got outlined. Same face, same weight. In fact, the same word, set the same way, will be untouched in one line, and be outlined elsewhere in the text. It's really baffling.
I need to access certain unicode characters (namely the x/8 fractions). I have the appropriate font installed, and the characters display in every other program on the machine, but they are not displaying correctly in Illustrator. If I type the characters in using alt codes, the 3/8 character displays as "", the 1/8 character displays as "[", etc. Is there some setting I need to change to enable support for Unicode characters?
If I type the character in another program, copy it, and paste it into Illustrator, it shows up as a box with an X through it. If I highlight the box and change the font to one that supports the character, then the character does display correctly. Is there a way to type the character directly into Illustrator?
When using the type tool in Illustrator, setting the font size to 150mm give me a character size of 107,373mm and in the H value window it says the size is 185,15mm wich mean that none of the sizes is actually correct when using text and for me that is usless because I get drawings with spesific text hight and length.
I recently upgraded my 07 macbook pro to a 2012 macbook pro with retina display running 2.6 GHz Intel Core i7 with 16 GB 1600 MHz DDR3 memory. I had no issues with my old mac the entire adobe ran perfect now I am having issues with Illustrator CS5. Each time I navigate the character drop down menu Illustrator crashes on me. I get this page: