Resize the selected objects

OK, so I'm trying to write a script that resizes the selected object. I have two selected objects, the above is an element, it is a rectangle. I'm trying to resize the rectangle the size of the group above it with a small margin around element. Here's what I have so far.

var design = app.activeDocument.selection [0];


var top = design.visibleBounds [1] + 5 * 2;

left is design.visibleBounds [0 var]-5 * 2;.

var width = design.visibleBounds [2] - design.visibleBounds [0] + 10 * 2;

var height = design.visibleBounds [1] design.visibleBounds [3] + 10 * 2;

var background = app.activeDocument.selection [1];

Background.position = (left, top, width, height);

The problem is the last line there. I do not know how to manipulate the size/position of the selected object, or if it is still possible I searched for it and haven not found an answer. Thanks in advance!

position property expects an array with x and y values, in that order. In regard to the properties width and height, use them in separate statements

background.position = [left, top];
background.width = width;
background.height = height;

Tags: Illustrator

Similar Questions

  • How to find my box selection? Cannot resize a selected object.

    How to find my box selection? Cannot resize a selected object.

    Display > display the bounding box

  • Shortcut - correspond to the selected object (sketch)

    y at - it a shortcut to make the outline of the selected objects? as fit to selected (work plan)

    Untitled-1.jpg

    Expand before anything has a stroke.

    the size of the box is accurate.

    then apply a line, as with any form suddenly half inside the form and the other half outside.

    is it the extra that's worrying you. You can set line inside.

  • get the position of the selected object

    is there a way to get the position of any selected object? It seems you should dive into a specific element such as frameworks of texts related to get the position, but he was curious to know if there was a generic way to do for the selected objects.

    If it's an item selected, Yes, if more than one, Yes, but it needs analysis

    Alert(App.activeDocument.Selection[0].position)

  • The selected objects and the markers?

    Hello!

    Not sure what just happened, but I think I can hit a hotkey shortcut to hide the visual aid for the selected objects.

    How can I change this back? I can't see which element (object, anchor, path, etc.) I chose on my work.

    This happened to me before and I don't remember how I fixed it, although I know it's a simple solution.

    Googling didn't help me, I'm afraid.

    View > show/hide edges.

    JET

  • With the help of Ia 3 - I can't resize all select objects

    Don't know what happened, but...

    When I click on an object, I am unable to adapt to the size.  I tried the selection tool and the direct and same selection tool problem.

    I can move the object, but it can not resize.

    help please - everyone

    My guess is that you just want to drag a handle with the selection tool, but that seems not work. No doubt the framework encompassing has been disabled. Go to the VIEW: see the bounding box. then give it a try. If it says "Hide encompassing" then I'm dead wrong and just ignore me.

  • resize the smart object?

    I can't resize a photo when I drag it to a new layer of another open project. I don't know if it's because it's a dynamic object or what. My workflow is

    photo Raw capture, edit in raw, open in new project as a smart layer, resize (fine), select split screen showing this project and the other. Then I drag the photo through to the other project. Opens a new layer in the project that I copied my picture, but I can't resize it for a reason any.


    Help... Please!

    Spaldo

    did you try Ctrl + T with that layer selected to bring up free transform?

  • Problem when resizing the round objects

    Hello

    I have a problem with the downward revision round objects.

    In summary, here's the question:

    round_corner_problem.jpg

    As you can see when I reduce a cirle of size size B, upper side and left of the circle B are flat.

    Why this happens and how to avoid it? It is really frustraiting when working with small objects.

    See you soon.

    Howdy.

    The flats on the small circles is caused by anti-aliasing misalignment with the pixel grid when the circle is resized. You will most often see when resizing a shape with an odd number of pixels. You have one see below the center of the circle is forced off the pixel grid, and anti-aliasing is disabled.

    This is the actual size.

    What should do?

    Before you accept the processing, move the circle to the center point of the circle is on the pixel grid. Use the arrow key to move around. Experiment. Move the center of the circle at different outside the premises of the grid before accepting the transformation. You will see all kinds of permutations of anti-aliasing. Choose one that is symmetrical. The focus should be on the grid. Then smoothing should be symmetrical. When the transform is applied, anti-aliasing is cooked in, and you can move back the circle to its original position if you wish.

    Like Paulo and Noel have noted, the quality of the original circle antialiasing will notice when it is reduced to the size of the web icons. Any asymmetry in the original may be noticeable to a normal size, because it is only about one or two rows of pixels on the perimeter of the circle. A small percentage of assymetry on a circle of 300px. When the circle is reduced to 10 pixels, the asymmetry affects another one or two lines of pixels. And the circle goes PEAR because the assymmetry could be as much as 10%. My guess is that the OP is working with images that are a little unhinged to start.

    There is much more to this, but it might help.

    Peace,

    Lee

  • Create the guide lines on the selected object

    Is there a quick way to create landmarks on a selected text box?

    Thank you

    InDesign CC, Windows 7

    (a) drag the mark to the edge of the frame. The edge is magnetic.

    (b) open the script Panel (window > utilities), oben group 'Application' and double click on "Add des Guides". If you need often do not forget that you can assign a keyboard shortcut to any script.

  • Adapt to the selected object

    Hello!

    This option can always ask how many years?  Ok... Please Adobe...

    Screen Shot 2014-04-29 at 22.27.14.png

    Kind regards!

    Zoom on selection for Adobe Illustrator - Macintosh

    http://www.worker72a.com

  • Why not transform the work? I'm doing a simple resize a smart object, and I constantly have problems. do not transformation. I had this same problem on several images and I've just updated to the latest

    I had frequent problems trying to resize the smart objects - I am unable to use the transformation. I had this problem on several images. I had some success by restarting Photoshop CC and Windows, but this does not always solve the problem. Is this a known issue? It's really annoying. I had this problem before the last update, and it continued after the most recent update.

    Hi djdphotography

    • You also have the same result if you create a layer duplicate the layer of the same image?
    • Also be sure that you do not have the Quick Mask mode by mistake (press Q to turn it off before you select the transform tool)

    Useful article:-Photoshop help | Free transformations of images, forms and paths

    Concerning

    ~ Assani

  • Object/image to toggle the selection question

    Went from CS3 to CS5 and discovered that they reorganized image selection. Can't tell if I'm cropping the image or resizing. With the selected object selection tool, the image of the circle seems to indicate that it is safe to crop, but it's still an uncertain when you work quickly. Is there any way to disable this, so I can go back to the more intuitive object select and direct, select as separate functions. (in other words, the default CS3)

    Really a pain when you're importing, cropping, and resizing. These object help executives fail to make the problem worse. I'm happy that they allow you to disable those 5.5.

    TIA

    View > Extras > hide content Grabber will turn off the "donut hole."

  • Move the selected layer shortcut object

    Hello world

    I would like to be able to invoke a script that would simply move the object selected (block of text or image) to another layer without having to open the layers panel, select the point and drag to another layer I. I find it tedious and awkward especially on repetition.

    I previously asked the people here how I could run a script that searched objects with an assigned attribute and retrospectively to move them all to a single layer. But I prefer to be able to hit a command with the selected object, which pushed the object on a specific layer.

    For me, this really should be a built-in shortcut, such as control-alt-down top /. As far as I can tell this is not assigned to anything else and would be really helpful!

    Can someone suggest a solution to do this, script or other?

    Thank you very much!

    Lewis

    How about this dynamic Duo?

    //DESCRIPTION: One Layer Down
    for (s=0; s
    
    //DESCRIPTION: One Layer Up
    for (s=0; s 0)
      app.selection[s].itemLayer = app.activeDocument.layers.previousItem(app.selection[s].itemLayer);
    }
    

    It works, even with a multiple selection on different layers.

    Be warned that, without the Panel layer open, you don't maybe not up-to-date on your active layer current! It changes because a selection is moved from one layer to another.

  • How can I fix the selection tool?

    How can I fix the selection tool to allow me to resize the shift? He was working before the upgrade. Now it won't let me resize the selected corners mean anchors?

    Choose View > show bounding box...

    You may have inadvertently he switched off function at some point.

  • Reverse engineering / import selected objects

    Hi all

    I'm new to tool ODI and try to understand how to reverse engineer / import the selected objects? I am unable to do this.

    For example, I have 10 tables in the database, I want to import / reverse engineer 3 of them, how do I do this at once? I'm able to do that, one by one.

    Your help is appreciated.

    Thank you

    Andy.

    Hello

    Create a template to.--> selective reverse engineering-click---> check the new store of data and object to boning. Then, you can select 3 tables of 10 tables.

    What do you mean by import here?

    You try to import 3 ODI tables?

    Thank you

Maybe you are looking for

  • I have download a fake version of firefox?

    Accidentally, I downloaded firefox on this site: http://www.freegogo-Download.com/?ADNM= {creative} & kw = firefox & mt = e & mn = {investment} & ct = {target} & nt = T & expr {aceid} = & ap = {adposition} & dv = c & & dr = cHaWck1mIXvlDmW4vExthXN3DK

  • IMAP does not download the Images Inline in Gmail

    To summarize: my client sends to my gmail address a lot of emails with inline images. When I read the email in Thunderbird, the images are not there. Here's what I see... The customer uses a solution Exchange/Outlook (not sure if it's relevant). They

  • Playing discs blu - ray in New Zealand

    I burned a blu - ray disc and sent to the members of the family in New Zealand. Who can't play TI-no is not recognized. They have a blue-ray player. I understand that Blu - ray is not NTSC or PAL, but there are regional restrictions. What region inco

  • Satellite 320CDT: what slim burner could be compatible?

    Hello! I use a laptop Toshiba Satellite 320CDT. It is not a new machine, a few years ago, but this is not the point. I only use it to run my favorite Delphi environment while I'm away from my desktop pc (320CDT offers me more than 3 hours of battery

  • How do I change the layout of keyboard characters

    Welcome. Some time ago I used a Windows system on the MacBook computer, but I want to switch completely to OSX.When I play League of Legends in the game I need letter a but under ALT + has its only. I'm Polish and I don't have MacBook or other laptop