Changing Global Spot with Javascript

Hello,<br /><br />I'm trying to update a swatch (global, spot) that is linked to a path object, say, a rectangle.<br /><br />In Illustrator, if I double-click the swatch, change the CMYK values and click ok, the path object fill colour updates to the new swatch colour.<br /><br />I want to replicate this with script.<br /><br />So far I have written:<br /><br />if (app.documents.length > 0){<br />     var swatches = app.activeDocument.swatches;<br />     for(i=0;i<swatches.length;i++){<br />          var currSwatch = swatches[i];<br />          if(currSwatch.name == "Prim1"){<br />               var newColor = new CMYKColor();<br />               newColor.cyan = 35;<br />               newColor.magenta = 0;<br />               newColor.yellow = 50;<br />               newColor.black = 0;<br />               currSwatch.color = newColor;<br />          }<br />     }<br />}<br /><br />Which updates my swatch "Prim1" and changes the colour as it's supposed to.<br /><br />However.<br /><br />The link to the object is lost, and the swatch is no longer global. Basically, it updates the swatch, and not the object (that's bound to it by its original global setup).<br /><br />Am I missing a line that tells my swatch to keep its global property?

Just in case you haven't gotten a reply<br /><br />Try<br /><br />if (app.documents.length > 0){<br />var swatches = app.activeDocument.spots;<br />for(i=0;i<swatches.length;i++){ var currSwatch = swatches[i]; if(currSwatch.name == "Prim1"){ var newColor = new CMYKColor(); newColor.cyan = 35; newColor.magenta = 0; newColor.yellow = 50; newColor.black = 0; currSwatch.color = newColor; } } }<br /><br />I would like to change the name also - Any ideas?<br /><br />Good Luck<br /><br />Nick

Similar Messages

  • Change "choiseListe" values with javascript

    Dear,
    Is it possible to change "choiseListe"  values  with javascript.
    Exemple il have a choseListe :
         Country //// Values
          USA            us
          France         fr
          Spain           sp
    When il click in a botton i whant to change this choceListe :
         Country //// Values
          Morocco           ma
         Portugal           pt
    Thanks

    Hi,
    Listboxes and dropdowns can be scripted against without too much difficulty.
    You would need something like this in the click event of the button:
    listbox1.rawValue = null; //clear previous choice
    listbox1.clearItems(); //clear the list items
    listbox1.addItem("Moocco", "ma"); //add new list items
    listbox1.additem("Portugal", "pt");
    Hope that helps,
    Niall

  • Change page attribute with JavaScript

    Hi,
    hope someone can help.
    Is it possible to change a BSP page attribute with JavaScript??
    I have a JavaScript array with some serialnumbers. After push a save button, i want to save the array data into a page attribute.
    Some ideas?
    Regards Anton

    Hi,
    The only way of passing vars from JS to page attributes is submitting them via (hidden) values in a form or via params in an URL.
    Alternatively, you can try to let JS store things in a client cookie and let the BSP read that cookie.
    I didn't try that out yet though.
    Eddy
    PS.
    Put yourself on the SDN world map (http://sdn.idizaai.be/sdn_world/sdn_world.html) and earn 25 points.
    Spread the wor(l)d!

  • Change 3D views with JavaScript code?

    I am looking for a way to change 3D views using JavaScript. I want to obtain similar result as the predefine action (Go to a 3D view) but with code.
    More preciselly, I want to connect items within a list box to different 3D views.
    Any ideas or suggestion would be greatly appreciated.
    Thank you
    Tutorial on how to use the Go to a 3D view action:
    Connecting Document JavaScript to 3D Views (PDF: 2.3M)
    http://partners.adobe.com/public/developer/en/tips/topic_tip3.pdf
    Related topics:
    looking for a way to switch views using Javascript
    http://www.adobeforums.com/cgi-bin/webx/.3bbed722/0
    SMOOTH TRANSITION BETWEEN VIEWS?
    http://www.adobeforums.com/cgi-bin/webx/.3bc0ce56
    Cameras vs. views; views.xml
    http://www.adobeforums.com/cgi-bin/webx/.3bbf0748/3

    hello maybe other have same problem i found a simple solution for me
    use the javascript bridge and juse the f4m manifest files
    function changeSrc(playerdivId,src){
                var player = document.getElementById(playerdivId);
                player.setMediaResourceURL(src);
    src multicast fm4 manifest like this
    http://sourceforge.net/apps/mediawiki/osmf.adobe/index.php?title=Flash_Media_Manifest_(F4M )_File_Format
    best regards

  • Change TextView value with Javascript

    Hello,
    I'm trying to find a way of changing the value of an HTMLB TextView on the client side with javascript.
    Do you know how to do that ? Cannot work it out...
    Many thanks
    Nicolas

    Hi,
    this can be a bit tricky, because you have to know, how to access the element. that means you need an unique id or an absolute position of the TextView-element
    if you can see, how to access the specific element in your client-pagesource, a possible javascript could be:
    document.getElementById("<id of element>").firstChild.nodeValue="My new Text"
    or access by name/count of the element:
    document.getElementsByName("<name of element>")[#position of occurance].firstChild.nodeValue="My new Text"
    kr, achim

  • Changing applet parameters with Javascript

    Is it possible to have an applet read a param value which has been changed with Javascript after the applet loads?
    I've tried changing the param value in this way, but the applet doesn't read the new value. It reads the default value in the HTML when the applet loads, and getParameter is in the main loop of the applet which runs and updates other (internal) values fine...

    Well that page says that param values can't be changed at run-time. Never mind though because I read some more and found out how to implement a method in the applet (which can be called from Javascript) that reads the host page's DOM, thereby achieving the same result.
    Thanks for the pointer.

  • Change php variable with javascript??

    Hey Guys
    I need to know how can i send the form to a different email address if someone selects an option from the "BSU(area)" on the HTML from.
    So basically if the are on the html form and they select NewCastle from the "BSU(area)" for example i want the script to change the email address to the address assigned to that option.
    How can i achieve this? If you guys need to see my PHP script let me know.
    Help please!!
    Here's the link: http://flyingant.co.za/invite.html
    yours
    Ashveer

    Yes i agree with you.
    Here's my script tell me where i am going wrong?
    <?php
    // Build message.
    $my_email = "";
    global $my_email;
    function build_message($request_input){if(!isset($message_output)){$message_output ="";}if(!is_array($request_input)){$message_output = $request_input;}else{foreach($request_input as $key => $value){if(!empty($value)){if(!is_numeric($key)){$message_output .= str_replace("_"," ",ucfirst($key)).": ".build_message($value).PHP_EOL.PHP_EOL;}else{$message_output .= build_message($value).", ";}}}}return rtrim($message_output,", ");}
    $message = build_message($_REQUEST);
    $message = $message . PHP_EOL.PHP_EOL."-- ".PHP_EOL."";
    $message = stripslashes($message);
    $subject = "Form To Email Comments";
    $headers = "From: " . $_REQUEST['Email'];
    mail($my_email,$subject,$message,$headers);
    ?>
    <?php
    function getValue($Result){
    //$Item = form.BSUarea.selectedIndex;
    $Item = $_POST["BSUarea"];
    //$Result = form.BSUarea.options[Item].text;
    $Result = $_POST["BSUarea"];
    switch ($Result) {
    case ($Result = "Gauteng"):
    //$Gauteng = "[email protected]";
    $my_email = "[email protected]";
    //$my_email = $Gauteng;
    break;
    /*case ($Result = CapeTown):
    CapeTown = "[email protected]";
    $my_email = CapeTown;
    break;
    case ($Result = Richards_Bay):
    Richards_Bay = "[email protected]";
    $my_email = Richards_Bay;
    break;
    case ($Result = Pinetown):
    Pinetown = "[email protected]";
    $my_email = Pinetown;
    break;
    case ($Result = Pietermaritzburg):
    Pietermaritzburg = "[email protected]";
    $my_email = Pietermaritzburg;
    break;
    case ($Result = NewCastle):
    New Castle = "[email protected]";
    $my_email = NewCastle;
    break;
    case ($Result = George):
    George = "[email protected]";
    $my_email = George;
    break;*/
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>BSU - Evite</title>
    </head>
    <body>
    <div class="main">
    <div class="content"></div>
    <form id="form1" name="myform" method="post" action="#build_message">
    <table width="525" border="0">
    <tr>
    <td width="270"><label><strong>BSU(area)</strong></label></td>
    <td width="10"> </td>
    <td width="240" align="left">
    <select name="BSUarea" id="BSUarea" onchange="getValue($Result)">
    <option value="Durban">Durban</option>
    <option value="Richards_Bay">Richards Bay</option>
    <option value="Gauteng">Gauteng</option>
    <option value="CapeTown">Cape Town</option>
    <option value="George">George</option>
    <option value="NewCastle" >NewCastle</option>
    <option value="Pietermaritzburg" >Pietermaritzburg</option>
    <option value="Pinetown">Pinetown</option>
    <option value="Polokwane">Polokwane</option>
    </select></td>
    </tr>
    <td width="270"></td>
    <td width="10"> </td>
    <td width="240"><label>
    <input type="reset" name="Reset" id="Reset" value="Reset" />
    <input type="submit" id="Submit" value="Submit" />
    </label></td>
    </tr>
    </table>
    </form>
    </div>
    </body>
    </html>

  • Change rtmfp groupspec with javascript

    hello
    is it possible to change dynamically the groupspec and play the new rtmfp group?
    test code
      var parameters =
                            {       src: "rtmfp://p2p.rtmfp.com/2924a8afa44eaff4aac318fe5b39248d277688d663c6dfb422e6e9663967d39b/"
                            ,       autoPlay: true
                            ,       groupspec: "G:0101010c040e6f747200"
                            ,       multicastStreamName: "stream"
                            ,       streamType: "live"
                            ,       streamName: "stream"
                            ,       controlBarAutoHide: false
                            ,   javascriptCallbackFunction: "onJavaScriptBridgeCreated"
                    // Embed the player SWF:
                    swfobject.embedSWF
                            ( "StrobeMediaPlayback.swf"
                            , "strobeMediaPlayback"
                            , 640
                            , 480
                            , "10.1.0"
                            , parameters
                            , { allowFullScreen: "true"}
                            , { name: "strobeMediaPlayback" }
    var player = null;
                    function onJavaScriptBridgeCreated(playerId)
                            if (player == null) {
                                    player = document.getElementById(playerId);
                                    document.getElementById("newchannelgroup").onclick = function(){
                                                   //HERE SET NEW groupspec and play the rtmfp
                                                    player.play2();

    hello maybe other have same problem i found a simple solution for me
    use the javascript bridge and juse the f4m manifest files
    function changeSrc(playerdivId,src){
                var player = document.getElementById(playerdivId);
                player.setMediaResourceURL(src);
    src multicast fm4 manifest like this
    http://sourceforge.net/apps/mediawiki/osmf.adobe/index.php?title=Flash_Media_Manifest_(F4M )_File_Format
    best regards

  • Change Browser Language with Javascript

    Hey
    I need to change the language of the user in the portal , using two small links , EN | PT  if the user clicks EN the browser language will be EN_US else pt_PT how can i do something like this?
    i'm looking for javascript solution mainly or anything else related to sap. thanks

    Hi,
    String user = null;
         try {
          user =
           WDClientUser
            .getCurrentUser()
            .getSAPUser()
            .getUniqueName();
         } catch (WDUMException e) {
          // fpm.getMessageManager().raiseException(wdThis.wdGetAPI().getComponent(), e);
    try{
    wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("user"+user);
    IUserFactory userfact = UMFactory.getUserFactory();
    IUserMaint userMaint = userfact.getMutableUser(user);
    userMaint.setLocale(Locale.FRENCH);
    userMaint.commit();
    wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("success");
    }catch(Exception e){
    Hope this code helps you.
    Cheers-
    Pramod

  • I need to change the sum of a column's total with javascript.

    Hi,
    The HTML output of a SUM column is as follows:
    <td align="center" headers="COST" class="t2data"><b> 827.49</b></td>
    I need to change the sum total with javascript.
    The initial loading of the page SUMs the DB values correctly. Then onchange JS for a couple of factors may change one items COST.
    When that one item's COST changes I need to reSUM the total with JS.
    I was trying the following.. I don't know JS to well.
         var tds = document.getElementsByTagName('td');
         for (var xtd in tds) {
         //alert('Here:'+xtd.headers);
         if (xtd.headers=="COST") {
         // you found the element, do what you need
         alert(xtd.innerHTML);
         After inserting the above code into my javascript is popups up
         my alert, "Here:undefined"
         and never hits the alert(xtd.innerHTML);

    Hi Ya'll,
    I got the following working. See any problems?
    headers=="COST" actually showed up in each row of the whole column, including the SUM. So it ended up being great so I could sum it in the JS.
    I had to change the column type to NUMBER from VARCHAR2 for the initial SUM to work, so adding any formating to the SQL was not good. It looks pretty much what Andy has though... I found a slight hesitation it it though.. I have to work out a bug that prints the old total instead of the first.
    var ltotal =0;
    var tds = document.getElementsByTagName('td');
    for (var k=0; k<tds.length; k++) {
    if (tds[k].headers=="COST") {
    var inputObjs= tds[k].getElementsByTagName('input');
    if(inputObjs.length>0) {
    for (var j=0;j<inputObjs.length;j++) {
    ltotal+= parseFloat(inputObjs[j].value);
    //alert(inputObjs[j].value);
    //alert(ltotal);
    }else{
    tds[k].innerHTML=ltotal;
    Message was edited by:
    changed i to k to avoid the italics
    Bill Carlisle

  • Change Tooltip with Javascript

    i want to change the tooltip-text with javascript.
    is there a way to do that?
    i have a lot of checkboxes and want to change the caption AND tooltip with javascript from an array. it works fine with the caption-text
    thanks
    herbert

    Hi,
    Try this.
    this.assist.toolTip.value = "Hi from Avoka";
    Regards
    Philip

  • Change a global variable with a function

    HI ALL!
    I have the following problem...
    I would like to change a global variable with a void function so not like this: variable = function(); .
    What do you suggest?
    Best regards,
    Korcs

    I have the following problem...
    I would like to change a global variable with a void
    function so not like this: variable = function(); .
    What do you suggest?>
    >
    I dont quite understand your question but if your variable is a reference to an object then you can certainly have a method to alter the object that the reference is pointing to and/or the reference itself..
    otherwise your 'function' will have to return the same type as the variable itself in order to do the assignment as you demonstrated, regardless of wether it's C, C# or Java, AFAIK, WIRNM
    HTH

  • Button with Javascript appearance changed.

    Hi,
    I created button with javascript from
    Re: Button and Function
    Everything works fine, But button looks different now
    No appearance of button is there & button label is displayed in orange color.
    Have i missed something or i will never like original.

    I have done some changes suggested by ATD for another thread.
    In your app, through Shared Components, Templates create a new button template based on a copy of an existing one (pick whichever existing template you prefer, the normal Button may be ok). When the new template is created, edit it. You should see something like the following in the "Template" setting:
    a href="#LINK#" class="t12Button" #BUTTON_ATTRIBUTES#>#LABEL#</a
    There may be other HTML around this, but this is the important part as it is the actual button itself. Change this to:
    a href="#" class="t12Button" #BUTTON_ATTRIBUTES#>#LABEL#</a
    Now, on your button on the page, change it to use your new button template. In the Button Attributes setting, add in:
    onclick="javascript:checkText();"
    everything works fine except appearance of button.
    Edited by: TEJU on Jun 4, 2009 10:21 AM
    Edited by: TEJU on Jun 4, 2009 10:22 AM
    Edited by: TEJU on Jun 4, 2009 10:24 AM

  • Webcontrol problems with javascript

    Hello,
    the page I want to navigate making me problems in my webcontrol. The same page works fine if I go there manually with the Internet Explorer. I force webcontrol to use another IE version than default. I changed regedit >
    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
    and a new key for my application with value 2af8(11000)
    If I do not force this version the used version in the webcontrol seems to be to old.
    I think that my application does not use the settings of my IE because if I use IE manually it works.
    I used Google and I can not find a property to force the webcontrol to activate javascript - it seems that I have to change this by the "global" settings.
    Edit: I do not exactly know if its javascript. The error is a script error.
    It does not help to suppress this errors - the page is not working correctly

    Hello,
    in the meantime I tried GeckoFX to solve the issue, but I get another problem later so I come back to the native webcontrol. To get help I will translate the error message because I can not attach a screenshot
    "Scripterror
    URL: http://www.transerv2000.de/DesktopModules/SNITNET_Metrix/js/rma_main.js
    Do you want to continue? Yes / No"
    Because I see the .js I think that this is an issue because of javascript.
    If I navigate to this site and do some work I have no problems. This is why I think that the used IE in my webcontrol is having other settings?!
    Please help and thanks alot.
    Edit: If I supress javascript errors, I got not Messagebox but the content dont work - so I really think that it is a problem with javascript. As I said, if I use the IE as application the page works fine.

  • Opening document in frame with javascript

    Hello.
    I've got problem with javascript on Safari 4 (both and on Win and on MacOS), while trying to open html document in frame.
    Reproducing the problem is quite difficult, so I'll begin with html source.
    I have one frame in index.html file:
    +<iframe id="topframe" name="topframe" scrolling="no" frameborder="0" width="980" height="580" src="form1.html";></iframe>+
    form1.html looks like this:
    +<input type="button" id="action" name="action" value="Make action" onclick = "document.getElementById('actionframe').src='dir/action.html';">+
    +<input type="button" id="sel" name="sell" value="..." onclick = "top.frames[['topframe']].location.replace('form2.html');">+
    action.html source is:
    +<script type="text/javascript">parent.document.getElementById('sel').click();</script>+
    So, when you open index.html, you see two buttons: first opens form2.html in the same frame, second opens dir/action.html in other frame. While dir/action.html just "clicks" the first button.
    Basically both buttons does the same.
    The problem is, that Safari fails to open form2.html with first button. Somehow Safari thinks that form2.html is in /dir/, like action.html is. So you get this error:
    *Not Found*
    *The requested URL /safari_test/dir/form2.html was not found on this server.*
    This example works on all major browsers, except Safari 4. Even on Safari 3 it works fine.
    I made an example, so you can test it here:
    http://82.135.245.49/safari_test/
    Message was edited by: Elvinas

    Have you tried putting the full URL instead of just form2.html?
    Second option is to move the file to that directory and change it for the other browsers.
    Third option is to stop using frames altogether, they are generally considered bad practice and can cause issues with browsers that aren't IE.

Maybe you are looking for

  • How to catch RFC errors in COM4ABAP destinations

    Hello all, I'm working on a project that uses COM4ABAP to call a custom COM object written in classic VB.  This maybe a generic RFC question so here goes. When I call a function like 'com_invoke' over in the COM4ABAP RFC destination, how can I catch

  • Account Based Profitability Analysis

    Hi, I am mapping characteristic fields of account based profitability analysis. I have been given fields such as KMLAND to map into BI fields.My question is how do i map the key figures. What fields in account based profitability analysis are key fig

  • Migration from SS7 to Oracle 8i

    We are planing to Migrate SS7 to Oracle 8i Rightnow we are using Operating System as Windows NT4.0. Is it good to change OS from Windows NT4 to Sun Solaris 2.6 or I can keep OS as same? What is your suggestion? What are advantages and disadvantages t

  • Dialup speed very slow

    We live in a rural area where we can not yet get high speed (except Hughes...too expensive--Wild Blue sold out of bandwidth--no one close enough for wireless yet). My dialup worked fine on my Mac until I attempted to setup a mixed Mac/PC 'network' by

  • I get error code 6 when i try to reinstall cs4design premium back onto my laptop

    i get error code 6 when i try to reinstall cs4design premium back onto my laptop anyone know what i should do? i need this for work