Illustrator Scripting :: How To Resize TextFrame While Also Resizing Its Parent (a Groupitem)
Oct 27, 2013
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.
To get the top, left and width of an groupitem without Clipping mask. Actually the group has Clipping mask. But i need only the width of the selection (without Clipping mask). I got these properties in scripting but including the clipping mask. The GUI itself shows different (i.e. Info -->: X:0 mm, Y:0 mm, W:full width [including clipping mask]. Transform palette -->: X:43.00, Y:22.0, W:64 [excluding clipping mask])
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 think the execution would be relatively easy. how to tell detect if a symbol is within a rectangle vector area. so almost like a parent child relationship in HTML goes? was thinking about getting top bottom left and right of a layer called parent then checking all layers below it (maybe they have "child" naming scene, so i can match by layer name) if the top bottom left and right are >=/<= the one above it. so it is basically detecting if a box is inside another box.
URL...need to detect is symbol1 is within div1 or 2 and same with symbol2
I have the following Adobe Illustrator file: [URL] .....
I would like to copy all visible elements of this file, and paste them onto a new file whose size is that of a standard business card. To do this I create the business card AI file in illustrator and then paste the contents of the AI file listed above onto the file with the business card artboard. SINCE THE ARTBOARD IS MUCH SMALLER, I Select -> All and Resize to 2%.
A. What I don't understand is why the bordeaux square in the middle does not resize proportionally when I carry out this operation. Instead it completely shrinks to a much smaller size.
B. Furthermore, I would like to completely get rid of the orange area that falls outside of the artboard. How can I accomplish this second task?
I have a few hundred vector files each of various sizes. I want them resize the vector shapes to the scale fit to 300"x200" artboard.I want them all to appear centered on a 300"x200" artboard.
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.
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;
[Code] .....
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.
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);
Just updated my LR to 5.3 from the CC and noticed a weird problem that I never encountered before in LR4 or 5.x (before 5.3 that is). I usually export pictures from RAW format to either TIFF or JPG (100% quality) and depending on purpose I use batch resizing, e.g. 1080 pixels on short edge ... well that whole Resize setting gets ignored by LR 5.3! It still exports full size (full RAW size in this case) into JPG or TIFF, but it won't resize .
EDIT: I found out that I checked the "Don't enlarge" box in Export dialog under Resizing, that's when resizing was not working. After I unchecked it then it works fine, but still what does that have to do with anything if we are talking about downsampling images from 5184x3456 pixels to 1620x1080 ...
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?
I have a parent groupwhich has multiple childs. By default, when parent group is selected, it propagates the Art configuration changed from panels (e.g. Gradient) to its childs, because its childs are also selected.
In some circumstances, I'd need some of those settings to NOT be propagated to one of the childs. How can I realize this?
Is it possible to use a textframe on a master page for means of common positioning of texts?
On pages based on this master page, I'd like to put individual text into this frame, or at least the exact location. Then, when I change the position of the textrame on the master page, the position of all textframes of the pages follow suit.
I have a pdf which is approx 25 pages, the original dimensions are 2500 x 2500. The pages are made up of text over artwork and I need to be able to resize the entire artwork and text to 384 x 512. Or the aspect ratio matching the same like 2048 x 1536. So far I converted the pdf to separate pdfs and opened each in Illustrator CS6 and need to first make the artwork smaller and then the text. Is there a set way to do this as I already tried creating a new doc in ai set for the new dimensions and copying and pasting the artwork. This is not that hard as the artwork I can manipulate but the problem is the text where some of it has strokes and other paths that make up each letter. I tried to ungroup but having a hard time. Would be great if I could just lift the text and just scale down.
I have only just got into using illustrator, after using photoshop for ages and getting bored with it, I have just made a vector image taken from a stock photo >here< at the moment it consists of 4 layers, one background white layer, a layer which has all the colour fills on, a layer with the outlines on it, and a final layer with some touch ups.
I realise now I should have made it in a much bigger size as I have been working on it at 400% and then scaled it down again on the nav and it just looks pathetic.
is there a way of resizing it as it is? or would I have to mess around with different progs and file formats?
I have had a quick browse to see if theres a thread on this subject, but cant seem to see anything of use.
I'm New to illustrator. I would like these bricks to get small as they go to the right. When I reshape them it cuts the bricks instead of resizing. How to get this effect of the bricks getting smaller.