to scale a textframe

Hello

I am trying to evolve a textframe to the dimensions of your choice with this script, but it does not work.

The manual JS says on a transformation matrix, but apparently the way it is coded in the script is incorrect.

Title = "Dimensions of textframe"; var

var width = number (Window.prompt ("width", 200, title));

var height = number (Window.prompt ("height", 800, title));

var a = app.activeDocument.textFrames [0] .transform (width, height, 50, 50);

How to make this work?

correct, to use transform() you must provide a transformation matrix.

If you just need to resize the text block with the dimensions given try this

var title = "Dimensions of textframe";
var width = Number(Window.prompt ("width", 200, title));
var height = Number(Window.prompt ("height", 800, title));
app.activeDocument.textFrames[0].width = width;
app.activeDocument.textFrames[0].height = height;

Tags: Illustrator

Similar Questions

  • TextFrame move to the previous position

    Hi Forum,

    Need help from you.

    After all the pageItems collection and resize (scale) to the new height page, I want to move the text Frames.geometricBounds [1] to the previous position before scaling were made.

    for example, before scaling: executives of related texts [i] .geometricBounds [1] is 12mm, 16.5 mm respectively.

    After consolidation and scaling of the group to the new height of page, I want to return the textFrames.geometricBounds [1] and 12 mm, 16.5 position.

    I tried to memorize the geometricBounds [1] frames of texts related to a table and after scaling was done, dissociated and tried to move all the frames of texts related to the previous position.

    var FO = app.activeDocument.textFrames.everyItem () .getElements ();

    for (i = 0; i < tf.length; i ++) {}
    var VAT = [];
    VAT.push(TF[i].geometricBounds[1].) Join ('\r'));

    Here scaling group is the new size of the page...

    If (tf [i]] .geometricBounds [1] < app.activeDocument.pages.item (0).marginPreferences.left;)

    {tf [i] .move ([tf [i] .parentPage, tf [i] .geometricBounds [0]]).}

    try to pass all the textframe to the previous position, when the textframe.geometricBounds [1] are not the left margin.

    }}

    trying to move all related texts frames which are not of the page.bounds [1] marginPreferences.left, after resizing the document.

    Thanks for help on this.

    Hello

    Try this to resize the last page of the doc. Do with the other pages if necessary.

    var
         targetPage = app.activeDocument.pages[-1];
         changedPageSize = [210,180];     // width, height
         currentPageSize = [
              targetPage.bounds[3] - targetPage.bounds[1],
              targetPage.bounds[2] - targetPage.bounds[0]
              ];
         wFactor = changedPageSize[0]/currentPageSize[0];
         hFactor = changedPageSize[1]/currentPageSize[1];
         mGroup = targetPage.groups.add( targetPage.allPageItems );
    
         targetPage.resize(
              CoordinateSpaces.INNER_COORDINATES,
              AnchorPoint.TOP_LEFT_ANCHOR,
              ResizeMethods.MULTIPLYING_CURRENT_DIMENSIONS_BY,
              [wFactor, hFactor]);
         mGroup.resize(
              CoordinateSpaces.INNER_COORDINATES,
              AnchorPoint.TOP_LEFT_ANCHOR,
              ResizeMethods.MULTIPLYING_CURRENT_DIMENSIONS_BY,
              [wFactor, hFactor]);
    

    Jarek

  • How to resize a textFrame, when resizing as its parent (a groupitem)?

    I am trying to find the smallest textframe within a group and then match that textframe font size to the minimum size allowed for printing. Everything works, except that I can't understand how to resize the textframe when resizing as its parent, the group.

    #target illustrator

    app.activeDocument = docRef;

    gpRef = docRef.groupItems [0];

    var gpHeight = gpRef.height;

    It's printing allowed minimum font size

    var minFntSize = 18;

    var garbLay;

    var txtFrmCount = gpRef.textFrames.length;

    var container = {};

    var i;

    put each prop textframe and height in json

    for (i = 0; i < txtFrmCount; i ++) {}

    container ["prop" + i] = {"gpTfHeight':gpRef.textFrames [i] .height / 72, 'gpTarget':gpRef.textFrames [i]"};

    }

    find the value prop textframe height min. I have the max in it too just in case I need it in the future

    var min = infinity;

    var max = - infinity;

    var x;

    for (x in container) {}

    If (container [x] ['gpTfHeight'] < min) {}

    min = container [x] ["gpTfHeight"];

    minTg = container [x] ["gpTarget"];

    }

    If (container [x] ['gpTfHeight'] > max) {}

    Max = container [x] ["gpTfHeight"];

    }

    }

    duplicate textframe, convert in way and get the actual height

    var txtFrmDup = minTg.duplicate ();

    txtFrmDup.position = [(minTg.position[0]-100), (minTg.position [1] - 100)];

    txtFrmDup.name = "garbage."

    var tOutline = txtFrmDup.createOutline ();

    tOutline.name = "garbage."

    var tLogHeight = Math.round (tOutline.height);

    garbLay = gpRef.groupItems.getByName ('garbage');

    This is the part where I need to convert it into percentage? tgSize is the size of the target and I thought I could get the different from the 2 and then use this amount to resize down...

    var tgSize = minFntSize - tLogHeight;

    var PERC = Math.round((tgSize/gpRef.height)*100);

    $.writeln (minFntSize);

    $.writeln (tLogHeight);

    $.writeln (tgSize);

    $.writeln (perc);

    resize gp so that font textframe min size meets minFntSize

    if(tLogHeight < minFntSize) {}

    gpRef.resize (perc, perc);

    $.writeln ('smaller');

    garbLay.remove ();

    } else if(tLogHeight > minFntSize) {}

    gpRef.resize (perc, perc);

    $.writeln ('bigger');

    garbLay.remove ();

    } else if(tLogHeight == minFntSize) {}

    $.writeln ('equal');

    }

    I do not know if I go about it the right way. Hoping a new set of eyes can take a look and see what I'm doing wrong or not done? Thank you!

    check this out, I changed it a bit

    // scale grouped text Frames to a minimum font size
    // http://forums.adobe.com/thread/1323065?tstart=0
    // carlos canto
    
    #target illustrator
    
    var docRef = app.activeDocument;
    var gpRef = docRef.groupItems[0];
    
    //this is the minimum print font size allowed
    var minFntSize = 18;
    
    var txtFrmCount = gpRef.textFrames.length;
    
    // make the first frame the one with the minimum font size
    var idx = 0;
    var minFrameFontSize = gpRef.textFrames[idx].textRange.characterAttributes.size;
    
    // see if the other frames have smaller font size than the first
    for(i = 1; i < txtFrmCount; i++) {
        var itext = gpRef.textFrames[i];
        var fontSize = itext.textRange.characterAttributes.size;
        if (fontSize		   
  • Remove the horizontal scale on circulars characters only

    Lino CrTronic used must have a command to set horizontal scale to 100% for these 3 characters and leave the rest alone.

    ® Circle R

    © Circle C

    • ball

    Because these 3 characters are circles often do we want their proportionate even if the rest of the copy is scaling horizontally.

    Try this version, this one deals with multiple instances of the same character in a text frame

    // carlos canto
    // reset a list of characters horizontal scaling to 100%
    
    // http://forums.adobe.com/thread/1299137?tstart=0
    
    var idoc = app.activeDocument;
    
    var roundC = '\u00A9';
    var roundR = '\u00AE';
    var bullet = '\u2022';
    
    var searchStrings = [roundC, roundR, bullet];
    
    var tFrames = idoc.textFrames;
    for (j=0; j		   
  • Then I reinstalled FCPX and some how the scale option is missing in the effects window. Can anyone help?

    Then I reinstalled FCPX and some how the scale option is missing in the effects window. Can anyone help?

    Try resetting your preferences. Organize your Opt - Cmd launches the application. Post screen shots of what you see.

  • What weight work with Apple health scale

    I think to buy a scale, but I want one that will record my weight in the application of health.  It would be great if it has WiFi or bluetooth.
    What brands are compatible with the health of Apple?

    https://www.Google.com/search?q=bathroom+scale+Apple+health & ie = UTF-8 & oe = UTF-8

  • Images are the scale is no longer with (img {max-width: 100% ;}) css from the 34.0.5 in firefox update, it still works fine in IE and chrome.})

    My site was working fine up until firefox updated 34.0.5. Now the images will not scale to fit the box more. I use flexbox so that the site is changing to adapt to the size of the browser. In css, I set img {max-width: 100% ;} and this would make the jpg file size automatically to fit the area they were in, but no more than Mozilla really screwed up this with updated 34.0.5.} My site still works fine with IE and Chrome, but 70% of my web traffic using firefox so I would really like this to work in firefox.
    Any help is greatly appreciated!

    I work by setting a special parameter in CSS for the images that I needed to scale and then I have it referenced by SPAN for each img in HTML, not quite how I wanted it to work since now images filling the box even with monitors really big format, which means that they could now be blurred on a 4 k monitor but firefox left me no choice. Looks like I have going to aid in future chrome like firefox really shit the bed on this 34.0.5 updated

  • Withings scale

    I bought a scale in an Apple Store and I can't connect with my Airport Express.I submit my problem to the Withings and they gave me 4 reasons:

    • or attempt to connect to a network of 5 GHz instead of a 2.4 GHz network. The scale is able to connect to networks of 2.4 GHz. This can be changed from the control panel of your router.
      • This isn't the cause of the problem the airport Extreme has 2 connections.
    • You are trying to connect to a network configured to something other than 802.11b/g/n, such as ac 802.11. This, too, can be changed from the control panel of your router.
      • Here, I think that my problem. Because my Airport is ac 802.11. My question is how can a scale may be sold in an Apple Store and network connection does not work with the airport?
    • The scale is too far from the wireless router. Rule so you can move the ladder closer to the router and try to connect again.
      • It is out of the question. I asked the scale behind the router.
    • The name of the network or the password use special characters (non-unicode) as u or o, or images emoji. The scale cannot connect to networks that include emoji or special characters in the name or the password.
      • do not apply to my network settings.

    How can I solve this?

    Thank you.

    By chance filter is your AirPort base station configured for MAC? I.e. programmed access? If so, remember to include the MAC address wireless of the measurement scale.

  • What scales smart link to health app?

    Ready to buy a smart scale. Those of you who will link the health iOS app?  Elle, Garmin, Fitbit, etc...

    According to technical data sheets:

    http://www.Apple.com/shop/product/HB930ZM/B/Withings-smart-body-Analyzer

    Withings seems to be advertising that they support health app directly, while others maybe not so much.

    Fitbit, according to other customers didn't seem to do this, but rather integrates with their own fitbit approx. Garmin is the same.

    Essentially, what I see is that if the company made an effort to integrate health of Apple app, they put themselves in the apple.com store inventory.

  • When the scaling in the layout, 1st page prints correctly, but the following pages were not properly/too large for the paper, parts of text missing scale

    When you try to print in Firefox and when the scale to the size of the page in the page layout, the first page prints correctly, but the following pages do not scale correctly and are too large for the paper, with the parts of the text are cut off at top and right. It is not fixed by checking or unchecking the scaling / shrink to fit page width "ignore" in the print window, or by changing the scale percent.

    I am running Firefox 15.0.1, on Mac OS 10.5.8.

    The same problem happens in preview print and if I save the copy in a .pdf file

    I tried all the fixes in the how to and others in various forums with no improvement.

    This happens everytime I try to print a document from scaling upwards or downwards in Firefox.

    I note the bug has been fixed and should in Firefox 21 right now, it will mean the use night http://nightly.mozilla.org/

  • Satellite X 200: The cloned on my TV image is not to scale

    I have connected my x 200 laptop to my TV plasma via HDMI cable.
    After much deliberation, I managed to find a way to get the sound through the TV.

    However, the image appearing on the TV is slightly out of scale. that is the picture on the TV is slightly too big, so all four corners are missing.

    Any suggestions on how to fix this?

    Concerning

    Hello

    I m not a X 200 owner, but I guess this unit uses the graphics card from NVIDIA.
    So I think that this problem is only related to incorrect settings in the nVidia control panel.

    I can't provide you with a solution exactly but I would recommend to check the settings in the control panel-> Nvidia Control Panel-> video & TV.
    You can change the view Advanced through the unique options.

    Good luck

  • Global scale

    Hi is there a kind of option, I can do a global scale for El captain? I just bought a 40 inch 4 k and while I can resize the desktop, files and fonts are small. When I try to view Option scale display... it only adjusts for this specific folder.

    System-> display-> radio button preferences-> choose a different 'resolution'

  • The scale of automatic renewal is missing to turn off subscription Zoosk

    The scale of automatic renewal is missing when I try to cancel my subscription to Zoosk via iTunes and App Store in the settings.

    The app shows the article in the 'manage subscriptions' your account? If not then you only accounts, the app has not been downloaded by another account? And you have tried on iTunes from your computer?

    If you do not find the option for auto-rénover then try contacting iTunes support stop it and see if they can find and stop it: https://www.apple.com/emea/support/itunes/contact.html

  • Questions about the scale of the DPI and the brightness of the screen on Satellite L350-145

    I'm trying to customize a L350-145 (screen 17 ") to a user who has some problems of Visual discomfort (difficulty with bright screens and small print).

    (1) ease of access of Vista, control panel DPI scale offers two resolutions, 96, and 120. Even the 120 is a bit small for this user, so I put a custom DPI to 144 (150%). However, I anticipate that some applications could not deal with this font size, so I intend to create a second user that the user could switch to which still had the standard DPI setting. However, to try this I find that change the DPI for one user affect the users of the computer. The DPI is implemented by not part of the user profile?

    (2) I set the brightness level to 1 (through power settings). However, even if this is a little live sometimes. Is there another way to lower the brightness of the screen further away?

    Thank you

    2. do you can not go lower. I guess you could buy a filter sieve that filters glare.

  • Photosmart HP 6520 printer: hp photosmart 6520 cannot set print at 100% scale/size

    What CD jewel box impression label width and higth suddenly became smaller. It works perfectly until recently. Have uninstalled and reinstalled the printer and drivers, but I am unable to find how re set the scale to 100%. in this hp6520 Photosmart printer.

    Any help would be appreciated: very happy smiley:

    After watching your @dlddemonscreenshots, I see that you use the HPDD896C (HP Photosmart 6520 series), it is a driver not driver HP class.

    I suggest all first to remove this driver and add the printer again. In fact, I suggest to use the following steps to remove the printer from the device and printers and the driver from the properties of the server.

    1. in the folder "devices and printers".

    2. choose "print server properties.

    • Win XP - with no printer selected, click 'File' then 'server properties '.
    • Windows Vista - with no printer selected, press 'Alt' and then click 'file' then 'server properties '.
    • Windows 7/8, 8.1 and 10 - select any printer in the "Devices and printers" folder and click on "Print server properties" above.

    3. click on the "Drivers" tab at the top of the window "properties of the print server.

    4. choose the printer that you want to uninstall, and then click 'remove '.

    5. choose "Remove driver only.

    6. the next screen will give a warning, letting you know that the removal of the driver package will remove it from the system. Click 'Yes' to say are you sure you want to do.

    If documents are stuck in the spooler to print, you see an error, cancel all documents waiting in the print queue or try restart the spooler to print, and then try to delete the driver from 'Print server properties' again. If she will not always remove the sachet, restart the computer and the printer should correct this error "in use" and allow the driver to be removed.

    Once the driver is then deleted, open start > all programs > HP folder > folder printer > HP Setup and software (or the icon of the printer).  The installation screen and the software opens and you can click on connect a new printer.

    Once you have added the HP driver, try to print a label again and let me know the result. In addition, you may need to change ' borderless printing: Print with border ' borderless Print.

    Let me know how it goes.

Maybe you are looking for