[AS] Set Gradient Fill Angle

I am using XTags to build a document in ID, but for some reason all my gradient fills have a 0degree angle and they all need changing to 90deg.
I can change a single box successfully, so I know the 'core' line of script works. My problem is finding a loop that does the job. The results are erratic. If the boxes with the fills are part of a group they don't change. If I ungroup everything (which I don't want to do as each group is a product image, description, price and need to move together), then a change happens - but although the gradient box shows 90deg, the boxes all look to be filled with solid red (instead of light to dark red as they should be).
This is the sort of thing I'm playing with:
tell application "Adobe InDesign CS5"
tell document 1
set gradboxes to object reference of every text frame whose name of fill color is "PromotionTypeGradient"
repeat with i in gradboxes
tell i
set gradient fill angle to 90
end tell
end repeat
end tell
end tell
I tried doing this with find/change, but got the same result - the fill seems to be solid red.
Any suggestions? Is my approach fundamentally wrong?
Thanks
Emma

Aha! Yes it was the grouped items. I still have a problem where the colour seems to go solid, but I think that's just my monitor. When I redefine the gradient with contrasting colours (as opposed to 2 shades of red as it should be) it all works, so I will try this at work tomorrow and fingers crossed a lot of time will be saved.
Thanks!

Similar Messages

  • Gradient fill angle snaps back to  - And Undo and history are buggy.

    Just installed Adobe Photoshop CC suite on new Mac Pro, Maverick OS, equiped with Waccom Tablet.
    Issues:
    Gradient Fill on Shape layer refuses to snap to entered angle. It simply returns to 0
    Double click the layer type -90
    Layer rotates in preview.
    Click OK
    Layer returns to original position ?
    Undo does not undo using hotkeys OR menus and the history list has issues moving back one step.
    If anyone has an solution to any of these question i'd be happy to know how to fix them.
    Thank you.

    Aha! Yes it was the grouped items. I still have a problem where the colour seems to go solid, but I think that's just my monitor. When I redefine the gradient with contrasting colours (as opposed to 2 shades of red as it should be) it all works, so I will try this at work tomorrow and fingers crossed a lot of time will be saved.
    Thanks!

  • Gradient fill not displayed correctly after applying a rotation angle

    Hello,
    I've created a rectangleframe and applied a gradient fill, and afterwards I have applied a rotation of -90 to the gradient fill. After the rotation the gradient does not display correctly anymore (after saving the document to .idml I've noticed that the property GradientFillLength was not recalculated after rotation). Is there a command to force the update or am I missing something? This problem occurs in InDesign CS3/CS4.
    Thank you
    UIDList targetList(m_SplineUIDRef);
    InterfacePtr<ICommand> applyCmd(Utils<IGraphicAttributeUtils>()->CreateFillRenderingCommand(
                    gradientUid, &targetList, kTrue, kTrue));
    CmdUtils::ProcessCommand(applyCmd);
    InterfacePtr<ICommand> angleCmd(Utils<IGraphicAttributeUtils>()->CreateGradientFillAngleCommand(
                    gradientAngle, &targetList, kTrue, kTrue));
    CmdUtils::ProcessCommand(angleCmd);

    Thanks. I saw those threads but this is not that issue. I really think that this is a bug in the latest update for illustrator.

  • Photoshop shape layer gradient fill bug

    I use shapes filled with linear gradient turned 90° from its default position. And every now and then, when I select the given shape layer (with the move tool or directly in the layer dialog) the gradient jumps into the default rotation position. The thing is, if this happens, there´s no way I can turn it back.. if I type a value or try to rotate the gradient, it always jumps back.. even if I create a new shape, the rotation function is set to default and won´t move a degree.. Normally a PS restart helped to solve this.. but today, the problem remained even after that.. I will reboot the system and hopefully it will work but.. if anyone has experienced the same problem or has any suggestions, please help.
    PS CC 2014 (latest update - though this problem I´ve had since the first CC), OS 10.8.5 (Maybe updating to Mavericks?)
    thanks in advance!

    I do not use a mac however on windows if I have a gradient filled shape layer I rotated the the gradient fill.  If I accidentally click the solid fill or pattern fill icon when I click back on the gradient fill icon the angle is the default 90 degrees it does not remember that the fill was set to 0 or 180.
    I have not observed any problem with the move tool but I seldom have a shape with a gradient fill.  I normally use a layer style gradient fill on a solid 50% gray filled shape,

  • Creating Gradient-filled shapes via JSFL CS5.5?

    I'm trying to use JSFL to create a number of oval shapes on a layer, that have a gradient fill applied to them.  I've stripped down the JSFL to very bare bones which I will post here:
    var flashDoc = fl.getDocumentDOM();
    var flashLib = flashDoc.library;
    var flashTimeline = flashDoc.getTimeline();
    // Set fill color for all shapes
    var fill = flashDoc.getCustomFill();
    fill.style = "radialGradient";
    fill.color = "#FFFFFF";    // For some reason if I don't assign at least *something* here, the color array doesn't work and I get fully black shapes
    fill.colorArray = ["#0033CC", "#FFFFFF"];
    fill.posArray = [0, 255];
    fill.focalPoint = 0;
    fill.linearRGB = true;
    flashDoc.setCustomFill( fill );
    for( var i = 0; i < 10; ++i )
        var x = Math.random() * 500;
        var y = Math.random() * 400;
        var radius = Math.random() * 25 + 25;
        var left = x - radius;
        var top = y - radius;
        var right = x + radius;
        var bottom = y + radius;
        flashDoc.addNewOval( {left:left, top:top, right:right, bottom:bottom}, false, true );
    When I run this script I do not get the results I'm expecting.  I get a number of oval shapes that all share the same gradient transform, i.e., each shape only gets part of the gradient.  The documentation says this function should be equivalent to using the draw oval tool, yet when you use that tool each oval you draw is associated with its own gradient transform.
    My Questions:
    1. Am I missing a piece here to create shapes each with their own gradient transform?
    2. Is it a bug that I have to set something into fill.color, even though I'm supplying a color array?  If I set nothing there, all the shapes will draw in full black.
    3. Is there a way to specify gradient colors that include alpha?
    Thanks for your time.

    Yep, that made the rest of my whole day!! Works excelllent in the demo, and i'm just replacing all the  Image<->Triangle commands. Wonderfulll & thanks a lot, LitDev. (enjoint the sb sample in your Test-DL :-))
    PS:
    Controls.SetTextBoxText(Controls.AddTextBox(10,10), "Enter your name here...")
    Controls.AddButton(".. then press the Button", 180,10)
    LDGraphicsWindow.Capture("","")
    GraphicsWindow.Clear()
    GraphicsWindow.DrawImage("ImageList1", 0,0)

  • Trying to make sense of AS2 gradient fill matrices

    This one will likely interest kglad, but I'm all ears for
    insight from
    anyone who digs math.
    I've been working with gradient fills lately in AS2, which
    means I've
    been reading through related entries in the ActionScript 2.0
    Language
    Reference. Here's a quick example right out of the docs
    (slightly revised
    to boil it down to the essentials). The Drawing API draws a
    square and
    fills it with a linear gradient that goes from red (upper
    left) to blue
    (lower right).
    this.createEmptyMovieClip("gradient_mc",this.getNextHighestDepth());
    with (gradient_mc) {
    colors = [0xFF0000, 0x0000FF];
    fillType = "linear";
    alphas = [100, 100];
    ratios = [0, 0xFF];
    matrix = {matrixType:"box", x:100, y:100, w:200, h:200,
    r:(45/180)*Math.PI};
    beginGradientFill(fillType,colors,alphas,ratios,matrix);
    moveTo(100,100);
    lineTo(100,300);
    lineTo(300,300);
    lineTo(300,100);
    lineTo(100,100);
    endFill();
    The point of interest, to me, is that generic Object
    instance, matrix,
    with properies x, y, w, h, r, and matrixType. The x and y are
    for position
    and correspond to the moveTo(100,100) call. The w and h
    represent width and
    height. The r is rotation in radians. The matrixType is
    arbitrary (I
    guess), because the same matrix can be used for a radial
    gradient -- never
    mind that for now.
    The properties shown, arbitrary or not, are the ones
    demonstrated in the
    docs. That snippet does draw a 45deg red to blue gradient.
    The docs recommend a slightly different approach for Flash
    Payer 8 and
    higher; namely, the native Matrix class. Everything in the
    above sample
    remains except that the existing matrix line changes to these
    two lines:
    matrix = new Matrix();
    matrix.createGradientBox(200, 200, (45/180)*Math.PI, 100,
    100);
    Pretty obvious to see where they overlap. The matrixType
    property is
    gone, but hey ... everything works, so I'm not going to go
    looking for
    trouble.
    Here's the punch line. The docs *also* show an alternative
    Object
    approach, one in which the properties describe a 3x3 matrix
    whose properties
    are a, b, c, d, e, f, g, h, and i. After toying with this
    a-through-i
    example, I noticed a pattern in the values: c, f, and i are
    0, 0, and 1
    respectively. That seems to correspond to the conventional
    graphics matrix
    a b u
    c d v
    tx ty w
    ... where u, v, and x are 0, 0, and 1. Seems fairly clear
    that tx and ty
    would correspond to x and y. After tracing the properties of
    the matrix
    variable (after the createGradientBox() call) it seemed
    reasonable to me to
    make the following mapping:
    a:a b:b c:0
    d:c e:d f:0
    g:tx g:ty i:1
    ... which led me to replace the original matrix declaration
    with this (back
    to a single line):
    matrix = {
    a:0.086316745750311,
    b:0.086316745750311,
    c:0,
    d:-0.086316745750311,
    e:0.086316745750311,
    f:0,
    g:200,
    h:200,
    i:1
    Those values, by the way, come from my tracing the
    properties of this
    matrix.createGradientBox(200, 200, (45/180)*Math.PI, 100,
    100);
    The weird part is, that still gives a 45deg angled gradient,
    but it's
    super-heavily banded. Not really a gradient at all, but more
    like four
    colored stripes -- red, blue, red, blue -- from upper left to
    lower right.
    Can anyone explain to me why?
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

    GWD,
    > I couldn't leave it alone. I came back to it.
    Ha! I know that feeling. :)
    > matrix = { a:200, b:-100, c:0, d:-100, e:200, f:0,
    g:200, h:200, i:1 };
    >
    > gets close, but its still not quite right. I think the
    difference here is
    > that skew is expressed differently.
    That makes sense. And yes, that comes pretty close.
    > I found a better explanation here:
    >
    http://www.flashdevils.com/tutorials.php?id=142
    Thanks, GWD! That helps a lot.
    > [I would be inclined to use the other approaches if I
    could get
    > away with it.]
    Yeah, I definitely agree. I find it odd that the docs even
    mention it,
    but since they do, I found myself elbow deep in wondering
    why. Thanks for
    input!
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Grouping Adjustment layer with Gradient Fill layer

    Page 151 of "The Missing Manual" suggests that one should be able to group a Levels Adjustment layer with a Gradient Fill layer so that the levels adjustment fades out to one side.
    If I understand this correctly, the setup would be:
    Levels Adjustment Layer (grouped with layer below)
    Gradient Fill layer (with a gradient from Opaque to Transparent)
    Photo in Background layer
    but I cannot get the desired effect of original picture on one side blending through to adjusted levels on the other.
    I can get the desired effect if I dispense with the Gradient Fill layer and simply manually create the gradient on the mask of the Levels Adjustment layer but this loses the advantage of easy adjustment of the gradient.
    [Thanks to those who answered my question about linking a mask to a layer. As this is a separate query, I thought it best to start a new topic]

    Sanders1,
    I thought I'd try it, myself, and got results that I did not expect...
    http://www.pixentral.com/show.php?picture=1OVdT0C7oX46DsPm6TrfT5xxrm3h
    1 - The background image.
    2 - I created a Gradient Fill layer using color (red) to transparent.
    3 - I created a Levels Adjustment layer, set to reduce red and green,
    leaving a blue image.
    4 - I grouped the Levels Adjustment layer with the Gradient Fill layer.
    Is this the type of result you are seeing? I wonder what is the logic.
    Byron

  • I need help making my gradient fill the width of my browser

    How do i set the background to fit my browser?  I don't want grey margins... Right now im using a gradient on my web pages background fill but Id like it to fit the whole browser.. i dont want it to have margins..Any ideas?

    As mentioned above, make sure that your "Browser Fill" is what you are applying the gradient to:
    Also, if you do not want your "body" to be white, you can set the fill on that to be transparent:
    Hope this helps!
    Julia

  • In Adobe CC 2014 has the styling options been removed for gradient fills and inner shadows?

    I was just setting up a simple button and can't seem to find the way to fill it with a gradient fill or apply an inner shadow to one of the states.

    Hi Gary,
    Here is the option for the gradient fill, http://prntscr.com/3woegn and here is the option for the inner glow, which can be used to create the effect of inner shadow, http://prntscr.com/3wofmd
    - Abhishek Maurya

  • Change the blending mode on the gradient fill within a shape layer?

    I can't seem to figure out how to do this, if it is possible.  I have a shape layer with a gradient fill,  that gradient fill layer needs to be set to multiply, by default its normal.  can the be done with scripting?

    Indeed it is not that easy to modify the blending mode.
    The blending mode is property(1), or property("ADBE Vector Blend Mode"), of the gradient fill.
    Normally the blending modes are listed in the BlendingMode object, and mutliply corresponds to BlendingMode.MULTIPLY
    But it doesnt work for shape graphics: if you try myGradientFill.property(1).setValue(blendingMode.MULTIPLY); you are out of range.
    The value to enter is actually the occurrence of the mode in the dropdownmenu, counting separators...
    so
    myGradientFill.property(1).setValue(4);
    Xavier

  • Gradient fills

    Hi, I want to create gradient fills that start from somewhere within an object rather than the edge. This allows me to create an object that looks more 3D, such as a sphere or a cylinder. At the moment the inspector in Keynote 4.0.1 only seems to allow me to change the angle around the edgeobject from which the gradient starts and not move the commencement of the gradient to a point within the object. This is easy in PPT. Any suggestions? Cheers, FAD

    Welcome to the discussions, fad1.
    You can't change the gradient in EXACTLY the way you want, but the use of some creative color picking might get you the next best thing. Here are some links to pages where I've used only Keynote's gradient tool to create some images I think have a nice 3D "Web 2.0" feel to them Some steps on how to produce the effect is on the page.
    http://web.mac.com/makentosh/tipsfromtheiceberg/Blog/Entries/2006/6/27To_saw,_is_to_see,yesternow.html
    http://web.mac.com/makentosh/tipsfromtheiceberg/Blog/Entries/2006/7/7Shiny_happythingies.html
    http://web.mac.com/makentosh/tipsfromtheiceberg/Blog/Entries/2006/7/13Shiny,_taketwo.html

  • Does using gradient fill count as one color?

    For my artwork, I can only use grayscale and one PMS color.
    Can I still use a gradient fill (i.e. from PMS 640 to white)?  Or do the shades count as separate colors?

    This depends on how you set up your spot color in the PSD file.
    http://www.google.com/search?q=spot+colors+in+photoshop

  • How can I get "distorted" gradient fills to copy & paste properly?

    Here's the situation simplified: I create a document and draw a circle and fill it with a circular gradient fill. I then copy and paste that circle into a new document. It looks exactly the same, and importantly, the gradient fill is still editable, so I can change the colours making up the gradient, their positions on the gradient-slider, etc.
    However, if I draw the circle in the first document, fill it with a circular gradient fill, and then I "distort" the gradient's shape to an oval shape, using the gradient tool — still keeping the circle itself as a circular shape (only the fill has changed shape) — and I then copy and paste this circle into a document, it does not get copied across properly as a "true" gradient fill.
    At first glance, it looks the same. However, viewing the circle in Outline mode shows that the gradient fill has been expanded into 100s and 100s of flat solid coloured objects, each one laid on top of another, getting progressively smaller and smaller, and all masked in the original circle shape.
    And of course, as the gradient fill has been expanded, it is no longer "live" and no longer editable, so I now can not edit its colours or positions on the gradient-slider, etc.
    So, how can I make it so that Illustrator maintains and keeps the correct gradient fill when copying and pasting between documents? I've tried editing all the settings under Preferences > File Handling & Clipboard, but all without success.
    At the moment, to overcome this "bug", I have to separate the two document windows by dragging its tab out of the main Illustrator window, so I now have two floating windows, rather than all windows tabbed in the one environment, and I then have to drag and drop the object from one window to the other. Slightly inconvenient, but it does get the job done.
    Strangely enough, dragging and dropping DOES work, whereas copying and pasting does NOT. Weird.
    However this slight inconvenience soon adds up when I have to do it many many many times over.
    And it gets progressively worse, because dragging and dropping does not allow me to place the object in the position I want it, whereas with copying and pasting, I could ordinarily choose to "Paste In Front" to place my object exactly in the same position between the two documents.
    In order to overcome this, I have to drag and drop to get the gradient fill across correctly, and then I have to copy and paste a non-filled duplicate version of the object to get it in precisely the same place, and then I have to use the alignment tools to get the two objects to line up. This = major inconvenience.
    And all this becomes even worse when attempting to copy an Illustrator object into Photoshop as a Smart Object, because when I then double-click the Smart Object in Photoshop to edit it, the gradient fill has been expanded — because, obviously, the object had to have been copied and pasted to get it from Illustrator into Photoshop, and this is the problem that Illustrator seems to be having.

    Thanks for the continuing answers guys, mucho appreciado.
    However, to go through what's been said since my last post...
    I tried launching Illustrator in another user account on this machine, but it wouldn't even launch! I got some error number (which I don't recall offhand, but I can re-check it later).
    To clarify, this is an official install of CS4 (so no pirating here!), and Illustrator was not running in my other main user account.
    And the InDesign thing wouldn't apply to me, as I don't use that app at all. I do invariably have a couple of other CS4 apps running though, usually always Photoshop and Bridge.
    I CAN understand how copying and pasting from Illustrator to InDesign would cause this though, because InDesign doesn't support live editable gradients to the same advanced degree that Illustrator does, so it has to expand it when doing so, thereby losing its editability.
    Copying and pasting whilst staying completely within Illustrator though is a different story.
    You know what — I just had a thought... What if this is nothing to do with Illustrator, but is instead something to do with my Mac OS's system-level clipboard?
    I actually had a 3rd-party multiple-item clipboard item installed some time ago, but then never used it. Maybe there's still remnants of that floating around and that's interfering with it somehow?
    I'll see if I can clear out all traces of it and see if it makes a difference... Fingers crossed!

  • Gradient filled background is not showing up in Internet Explorer on a PC.

    My gradient filled background is not showing up in Internet Explorer on a PC.
    I'm working on a MAC, so I don't know of anyway to preview a new MUSE Site in I.E. since it's no longer supported on a Mac.
    When the Home Page is viewed, my blue sky gradient background shows up as a white box?? I need a fix for this please.
    Here is my url:  www.ThanksSanta.org

    Hello,
    We might have to look into your .muse file to have a better look into the issue.
    I tried it on a sample file but it worked fine for me.
    Could you please e-mail your .muse file on [email protected] You can use Adobe SendNow service (https://sendnow.acrobat.com/) to send your file in case it is larger than 20MB.
    Please do not forget to mention the link to this forum in your e-mail.
    Regards,
    Sachin

  • Having problems with gradient fill.

    Having problems with gradient fill. Not sure how to select the gradient circles between outer circles consistently especially when there are more than 3 colors.

    Hi,
    It should be somewhat easier to try that out in landscape orientation. Does that help?
    thanks,
    Ignacio

Maybe you are looking for

  • Mac OS X Lion (Late 2010) having Recovery screen freeze with spinnig wheel

    I have a Mac Air purchased in December 2010 with Snow Leopard. I upgraded the OS to Lion and now running 10.7.4 version. I recently tried to use 'Disk Utility' feature to 'Verify' the disk which asked me to repair through 'Recovery HD' which is done

  • Error in AS2 sender communication channel

    Hello, We have a scenario where we are receving IDoc XML from our partner via AS2. While doing so,we are receiving following error: Error while parsing AS2 message: AUTHENTICATION_ERROR # When we try to send a normal text file,it works,so this cannot

  • Over current

    I have a 2nd-gen ipod shuffle, connecting it to a MacBook, i get the Over Current warning and it will not charge. it used to work fine then it suddenly stopped working yesterday, no changes made that i can remember.

  • Initialize a global with a global from another file

    hi, I know that initialization order for global variables across compilation units is not defined, but if I have file1.cpp   int x0 = 33, x1 = 55;   extern int y0, y1;   static int a[] = { y0, y1 };   void print_a( void ) { printf( "\na[0] = %d\na[1]

  • Unable to apply color formatting to document library custom view using javascript

    Hello, I have applied color formatting to some values in Document library at "Allitems.aspx" page. Created one view where record of library displaying as per sort rule and trying to apply the color formatting on that view, but its not getting apply.