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) {} } }
I am working with scripting in Ai, fill gradient color in TextFrame. I search in this forum but the other topics fill color to path or line. For now, I can make a gradient color, but I don't know how to apply it to textframe.
I'm trying to read a text file into a textFrame. It reads in but is not including linefeeds so it's just one big long line of text. I'm using the following code to read the file. I attempted to insert a character after each readln() but that didn't work. I also tried creating a variable that the readln() was stuffed into before setting the textFrame.contents to the variable, but that didn't work either. I'm stumped.
while (! notesDoc.eof) { noteTextRef.contents += notesDoc.readln();}
* this script will prompt the user for a file name and location and then save the current file as a .pdf with secure save options*/ var curDoc = app.activeDocument; var destName = prompt ("Enter a Filename Daniel", "", "Save With Security"); var destFolder = Folder.selectDialog('Select which folder to save to :'); saveFileToPDF(destFolder+ '/' + destName); // not sure if i need this here ?
[Code] .......
i can do the math of (artboard width)-(text width) / 2 is start point of text but how do i find out the text width and the artboard width?
I think I might be doing this wrong, I am trying to get contents of a specific textFrame within first group on layer called "page numbers"
It seems to work, but is a bit sketchy, the documentation indicates textFrame is all the text frames in a document, and that textFrameItem should be the specific one within collections of groups etc, maybe I am misunderstanding. this is what I am using:
var existingPageNumbers = app.activeDocument.layers.getByName('page numbers').groupItems[0].textFrames[0].contents;
I'm trying to find the smallest textframe within a group and then matching that textframe font size to the minimum size allowed for printing. Everything else works, except I can't figure out how to resize the textframe while also resizing its parent, the group.
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'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?
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.
I want to change the font(let's say Times New Roman) of selected text in textframe when I click on menu-item of my plug-in. I went through the Adobe Text Engine documentation and tried some code for setting font but failed. I don't see any member function in IFont class to set desired font, so unable to move forward. see the code. I would like to know one more thing that how can we set a particular font for a textframe?
TextRangesRef rangesRef = NULL; result = sAIDocument->GetTextSelection(&rangesRef); aisdk::check_ai_error(result); ITextRanges ranges(rangesRef);
I am trying to make the olympic rings, but when I try to divide the rings using the pathfinder, nothing happens. It just ignores any klick on the pathfinder tool. Is this a new feature of CS6 or is it just a bug?
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?
In CS5, I created a very handy action that allowed me to, with two paths selected, Divide, Ungroup, and Deselect, resulting in the divided paths without having to do each step manually.
In CS6, for some reason this is no longer possible-- if I try to record the same action, after the divide, everything is automatically deselected and I get a "The object "Ungroup" is not currently available" error. Very frustrating that the new version is more troublesome to use!!
I KNOW that it's possible to do this because I was somehow able to fudge it at one point and get this action to work. But I'm not sure what happened-- maybe a step was deleted in my action or something-- but one day it just stopped working. This action is basically THE function I use most in Illustrator given the way I work, and while it's not a huge step, having to manually reclick, ungroup, and deselect is a huge inconvenience.
I have no problem dividing objects using the "divide" tool in the Pathfinder palette, but I was wondering if there was a way to divide brush strokes?
For example, let's say you wanted to paint three brush strokes right next to each other, but not overlapping. Is there a way to select all three strokes and then divide them so no one stroke resides over another, they would be completely separate of each other.
How can I divide a line into equal segments in Illustrator? This is computer software, right? Shouldn't a computer be able to figure how to segment an arbitrary line? I tried turning the line into a sliced object and dividing that, but it didn't seem to work. Pathfinder only works on two or more objects.
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.