Assign units with a script

I am struggling to assign a "proper" unit from the unit catalog to my channels using a script.
At the moment the "unit_string" property of my channels simply has a string e.g. "N" or "degC" written to it.
I thought I would be able to return a unit object from the UnitCatalog object and assign it to the channel but I don't seem to be getting anywhere.
Many thanks,
Steve.

Hi St3ve,
I'm sorry about my previous post, it seems that I misread your question.
Have you looked at this article on assigning channel units?
When referencing the channel "unit_string" and manually entering the units, what sort of output do you receive? Which units are you trying to reference, are they user defined?
As for the "unit_string" property only containing limited values, have you enabled the appropriate units in DIAdem?  You can do this by navigating to DIAdem » Settings » Options » Units to ensure that the appropriate selection have been enabled for use.
For configuring channel properties through referencing these sets, please see this article.
You can also define your own unit set programmatically as shown in this tutorial.
Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

Similar Messages

  • I want to read and assign value of ADF Table rows  with Java Script

    Hi,
    I want to read and assign value of ADF Table rows with Java Script, but I cant true index of current row , so I assign wrong value to anathor column of ADF Table.
    My Code;
    ADF Table items
    <af:column sortProperty="Adet" sortable="false"
    headerText="#{bindings.RezervasyonWithParams1voHarcamaOdeme1.labels.Adet}"
    binding="#{backing_ucret.column2}" id="column2">
    <af:inputText value="#{row.Adet}"
    required="#{bindings.RezervasyonWithParams1voHarcamaOdeme1.attrDefs.Adet.mandatory}"
    columns="10"
    binding="#{backing_ucret.inputText2}"
    id="inputText2" onchange="getTutar('#{bindings.voHarcamaOdeme1Iterator.rangeStart + bindings.voHarcamaOdeme1Iterator.currentRowIndexInRange + 1}','#{bindings.voHarcamaOdeme1Iterator.estimatedRowCount}','#{row.index}')">
    <f:convertNumber groupingUsed="false"
    pattern="#{bindings.RezervasyonWithParams1voHarcamaOdeme1.formats.Adet}"/>
    </af:inputText>
    </af:column>
    MY JAVA SCRIPT CODE
    <f:verbatim>
    <script language="javascript" type="text/javascript">
    function getTutar(rowkey,totalrow,currentRow){
    alert('rowkey--totalRow--currentRow-->'+rowkey+'--'+totalrow+'--'+currentRow);
    if (currentRow==0) {
    rowkey=totalrow-1;
    }else{
    var rw=totalrow-currentRow-1;
    rowkey=rw;
    alert(document.getElementById('form1:table1:'+rowkey+':inputText8').value);
    alert(document.getElementById('form1:table1:'+currentRow+':inputText8').value);
    var birim_ucret=document.getElementById('form1:table1:'+rowkey+':inputText8').value;
    var adet=document.getElementById('form1:table1:'+rowkey+':inputText2').value;
    document.getElementById('form1:table1:'+rowkey+':inputText3').value=birim_ucret*adet;
    document.getElementById('form1:inputText6').value=0;
    var t;
    var toplam=0;
    alert('before Sum');
    for (var i=0;i!=totalrow-1;i++){
    t = document.getElementById('form1:table1:'+i+':inputText3');
    toplam+=t.value*1;
    document.getElementById('form1:inputText6').value=toplam;
    </script>
    </f:verbatim>

    You can achieve the use case you describe with partial page rendering (PPR), a feature of the ADF Faces framework. Here are a few posts that achieve an interactive behavior using PPR. Off the top of my head I do not know of an exact example, but this should be a good starting point:
    http://thepeninsulasedge.com/blog/2006/09/12/adf-faces-aftableselectmany/
    http://thepeninsulasedge.com/blog/2006/08/31/adf-faces-working-with-aftableselectone-and-the-dialog-framework/
    --RiC                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Help with vim script

    Hi,
    I'd like vim to set the spelllang variable automatically depending on the recipient of the email I'm about to write.  The plan was to do something like the following:
    if (grep -q address ~/.vim/foreign_language_speakers)
    setlocal spell spelllang=foreign_language
    where ~/.vim/foreign_language_speakers is a text file with the e-mail addresses people I communicate with in whatever language and the variable address is obtained from the "To" line in the e-mail.  I understand grep within a vim script doesn't work exactely as in bash.  I tried redefining the grepprg variable to grep -q &> /dev/null and the do
    let bolean = grep address ~/.vim/foreign_language_speakers
    and then the if statement, but no luck.  vim tells me grep is not a variable.  Clearly there's somethiing I haven't understood about assigning variables in vim scripts.  I also tried vimgrep but have the same problem assigning the boolean result to a variable.
    Any help appreciated
    regards

    So all of this is just to set the column widths to the sizes pre-defined in a paragraph style, i.e., always the same?
    I feel like I almost could do that in VB!
    But in Javascript, all it needs is sth in the ilk of
    var myWidths = [ 10, 50, 100, 50, 12 ]; // in whatever units you fancy
    var myTable = app.activeDocument.stories[0].tables[0];  // (just grabbing some table)
    for (i=0; i<myTable.columns.length; i++)
    myTable.columns[i].width = myWidths[i % myWidths.length];
    .. and the most interesting thing here (written from top of my head) is the "myWidths" lookup: it doesn't matter how many columns there are in this table, 'cause the widths array wraps around. (But you won't need this because you know all of your widths in advance.)

  • Change Page size with a Script

    I have made artwork in Illustrator that is set up as two page spreads on 1 artboard.
    I need to convert this to single page spreads.
    I.e. So for half the documents, I need to set the anchor point of the document to top left and half the width of the artboard.
    For the other half of the documents, I need to set anchor point to to right and half the width.
    Is this possible with scripting?
    I have look around online to find ways of accessing the document size and anchor point via scripting, but cannot seem to find any resources.
    Thanks for any help that can be offered.
    Edit: Also is it possible to create a new artboard with a script and assign it a name?

    here you go, this script splits the artboard in two
    // carlos canto
    // http://forums.adobe.com/message/5380624#5380624
    var idoc = app.activeDocument;
    var ab = idoc.artboards[0];
    var abBounds = ab.artboardRect;// left, top, right, bottom
    var ableft = abBounds[0]; // 0
    var abtop = abBounds[1]; // 612
    var abright = abBounds[2];
    var abbottom = abBounds[3];
    var abwidth = abright - ableft; // 792 // width
    var abheight = abtop- abbottom; // 0 // height
    var half = ableft + abwidth/2;
    var abright2 = half;
    ab.artboardRect = [ableft, abtop, abright2, abbottom];
    var ableft2 = half;
    var newAB = idoc.artboards.add([ableft2, abtop, abright, abbottom]);

  • Adding a specific org unit with a user id.

    Hi SAP Master,
    How can I add a specific organization Unit with a particular User Id, i.e when ever that user id logs in into system and create a transaction the org. unit assigned with him determined automatically.
    And one more query, how can we send a org. unit for approval? 
    Thanks and Regards
    Rahul
    Edited by: Rahul07 on Jun 10, 2011 10:18 AM

    Hi Rahul,
    We don't assign the Organization unit to the user in the SU01. In SU01 we assing the PFCG roles and authorization related stuff.
    Rather we create the Organization model, assign positions and then assign the user to the relevant position under the required organization unit using the tcode "PPOMA_CRM".
    When you setup the Organization determination procedure, then automatically while creating the transaction, the Organization Unit of the person who is creating the Transaction gets determined.
    rgrds,
    Randhir

  • Org Unit with more than one Chief Position

    Hi,
    we have implemented MSS via the portal using a one-to-one relationship between Org Units and Chief Positions, and we would now like to have multiple Chief positions attached to one Org Unit.
    As far as I can tell from the SAP documentation, this should be straightforward, but the results we are getting do not seem correct.
    I have an Org Unit that has position 1 and position 2 assigned to it with relationship A/B 012 denoting that they are Chief Positions.
    User 1 is holder of position 1 and user 2 is holder of position 2. 
    Both users have the same security roles.
    The views used on the portal are configured using the MSS Object and Data Provider functionality, using the standard ORGEH view, evaluation path for root objects SAP_MANG and evaluation path objects SBES.  The checkbox 'Excl. Managers' is ticked.
    The problem is this - both users can see all the subordinate employees in the Org Unit when they log on to MSS but user 1 can also see user 2 in his list of employees, which is not correct as user 1 and user 2 are both chiefs.  User 2 cannot see user 1 in his list of employees, which we would expect.
    The only logic we can see for user 1 being able to see user 2's details is that user 1 must be somehow defined as the 'superior' Chief Position, but we have not defined this as far as we know.
    Any ideas as to why this is happening for us?
    Many thanks,
    Fran.

    Hi Fran,
    Sounds like you have set up the reporting structures and MSS properly.  I do question why two chiefs for one org unit.  As you stated, both can see all employees and so both can approve time, give pay increases, etc. without the approval of the other.  If this is want you want, then you have set it up properly.  Usually, one has to approve the actions of the other, thus, is in a superior relationship.  This can be handled by having a higher level new org unit with the higher person as chief and the lower stay as head of the lower org unit which reports to it. 
    As you have it now, both individuals have the same rights and access.  They should both be excluded from iViews if you checked the "Excl. Managers" box.  Since, you just recently made one a manager, have you checked for any date dependencies?  If the Chief #1 is selecting a view for "Current Year", for example, he would be able to see all persons who reported to him for this year, which includes Chief #2.  There are no 'superior chief' designations (except by structure), so without being able to view your configuration, my suggestion is to check all dates for the assignments and relationships vs. dates of the view.

  • Organizational Units with Business Partner

    Hi Experts,
    I'm creating my organizational structure on CRM system: on transaction "PPOMA_CRM" I'm creating all the organizations I need. But I 'm facing with a problem: I'm not able to assign them a business partner. I mean: in the transaction "PPOMA_CRM" under the column "Business Partner" I'm not able to insert any business partner.
    And on the other hand, if I go on transaction "BP" in order to define a new organization, when I select which is  the BP role to use for the creation of the organization, I don't see BUP004.
    Do you have any suggestions.
    Why I can't see it?
    And what I have to do to assign a business partner to an organization?
    Full point sif it helps.
    Thanks a lot.
    Best regards,
    Stefano

    Hi,
    Please find below my answers:-
    In a first moment I configured the HR-CRM integration and when I go on transaction PPOMA_CRM in order to display the Organizational Structure I can see, for each Organizational unit downloaded from HR, a business partner ID under the column "business partner". This is the same number ID which allows to identify the same Organizational Unit on transaction BP.
    Answer- In Transaction BP you can find the same Org unit business prtner created in PPOMA_CRM.
    Suppose you have created BP_Org in PPOMA_CRM which has got generated with certain BP number.But this will not reflect in transaction BP. All the Business Partners created under BP_Org will be getting reflected.
    Now I deactivated the HR-CRM integration and when I create a new Organizational Unit on PPOMA_CRM I'm not able to fill the column "Business Partner".
    Ans- If you have not maintained in HR-CRM Integration there will be no number range.
    If I insert the Organizationa Unit ID (displayed on PPOMA_CRM) in transaction BP I don't get any results.
    Ans- While searching in BP , first you donu2019t have option of searching BP with Org Unit ID but you will find number instead. But as I told you earlier this will search the Business Partner under your Root Organization in our case it is BP_Org. You cant search for BP_Org in Tx-BP
    I need to assign a business partner to my organizational unit for escalation purposes since the escalation is succesfully only for the organizational units with that business partner ID, i.e. all the organizational units downloaded from HR.
    So at the moment the escalation process doesn't work for the organizational units just created only on CRM standalone system.
    I think it is possible to make it work also for these organizations, but I don't know how!
    Ans-  You will have to maintain as below-
    Customer Relationship ManagementMaster DataBusiness PartnerIntegration Business Partner-Organization Management Set Up Integration with Organizational Management
    HRALX- OBPON =ON
    HRALX- ONUMB
    HRALX-OSUBG
    HRALX-HRAC=
    Regds...
    Arup

  • How to Create Organization unit with customised code?

    Hi all,
       My business requirement need to create a Organization unit with a customised report.
    That customised report need to be developed in which i will be incorporating the code to create a new orgganization unit in sap
    and also to assign it in the organization structure.
    Please suggest me the Function Module to create it...or any sort of Standard report which is already doing that
    Thanks and Regards
    Sonal Jain.

    If I understand you correctly, you want to create a PROGRAM to create an Organization Unit (IT1000) and it's relation to it's parent Org.Unit (IT1001 with relation A_002).
    Check out program RHCOPY00, and create a Z version adapted to your needs.

  • Help with Indesign script

    Would anyone be willing to help me with a script? I need to Find the first table using "ERTStyle1" table style, convert it to text, change the text style to "Tabfix" paragraph style, then convert it back into a table using the table style "ERTStyle2" convert the top row to a header. It needs to repeat this process until there are no tables left using the "ERTStyle1" table style.
    I think I could almost do this myself using VBScript, but I am relatively new to scripting, and to be honest, I am hoping I can use this script to jump start my knowledge of VB in Indesign.

    So all of this is just to set the column widths to the sizes pre-defined in a paragraph style, i.e., always the same?
    I feel like I almost could do that in VB!
    But in Javascript, all it needs is sth in the ilk of
    var myWidths = [ 10, 50, 100, 50, 12 ]; // in whatever units you fancy
    var myTable = app.activeDocument.stories[0].tables[0];  // (just grabbing some table)
    for (i=0; i<myTable.columns.length; i++)
    myTable.columns[i].width = myWidths[i % myWidths.length];
    .. and the most interesting thing here (written from top of my head) is the "myWidths" lookup: it doesn't matter how many columns there are in this table, 'cause the widths array wraps around. (But you won't need this because you know all of your widths in advance.)

  • Assign a local logon script using Group Policy

    Is there a way to assign a local logon script using Group Policy? The reason I ask is that I wrote a logon/logoff script that will record the date/time, user, and computer for everyone who logs on to any machine in the domain. Right now it's set on a domain
    GPO, so it works great for domain accounts, but I'd like to extend that functionality to local accounts as well. The only way I know how to do that would be to set my script to run using the local policy. Since I don't want to manually go around to all 400+
    machines in my domain, I would rather find a simpler way of modifying the local policy. Any ideas?

    Martin, thank you for your response. That's exactly the kind of out-of-the-box answer I was looking for, unfortunately, it looks like I can only do that for Logon scripts. I don't see an option for Logoff. (Maybe the took the Logoff functionality out?
    This article says there should be a Logoff item in the GPO, but they're talking about Windows 2000 in that article.)
    Matthias, I started playing around with what you said, and I noticed that the "Scripts" key only seems to show up on my Windows 7 clients. The XP workstations don't have that key. Plus I did some testing, and I think I can do it without having
    to mess with the registry at all.
    So I think I have a workable solution at the moment. I found
    this article that talks about copying Local Polices from one computer to another. I tried manually setting the Logon/Logoff scripts in the Local policy on a fresh machine. From that reference computer I copied the Scripts folder out of the %SYSTEMROOT%\System32\GroupPolicy\User
    directory. It also created a gpt.ini file in the %SYSTEMROOT%\System32\GroupPolicy directory. The gpt.ini file contained an attribute called gPCUserExtensionNames, and one called Version. The gPCUserExtensionNames attribute specified two GUIDs, which
    I assumed to be the GUIDs that identify the Local Policy. I tried manually creating the Local policy on several different machines, with several different Operating Systems, and those GUIDs always seemed to be the same (not sure why). So I copied the gpt.ini
    file off the reference machine as well. When I placed all of the files I copied from the reference machine on to a new machine, everything seemed to work just fine (no registry modification necessary), with one caveat. It seemed to be running the script twice.
    So I went back into the gpt.ini file and deleted one of the GUIDs listed under gPCUserExtensionNames, and now the script runs just once!
    So I think this solution will work ok for me. We don't have any other Local Policies in place, so demolishing all existing Local Policies is perfectly acceptable in my case. I'm just not sure if I'm doing any damage by copying the gpt.ini file from a reference
    machine (if anyone can expand on how that works, I would appreciate the peace of mind that I'm not making things worse by doing this). So all I need now is to write a Startup script, or an SCCM package to deliver the Logon scripts and associated ini files
    to the appropriate location on all the domain PCs. Easy enough to do on my own. If anyone knows of a reason why this method is a bad idea, please post here. I'll be testing it out on a handful of PCs in the mean time.
    Hi Guys,
    Will this solution work for my case? I have a forcereboot batch script that I need to load on the local policy (logoff script through GPEDIT) however I can only load it manually. I need to do it on multiple machines (approx 5000 computers). I am having
    trouble doing it using powershell. Is there any other options to do it? 
    Will I have to use the same GUID's you mentioned on the gpt.ini file? (gPCUserExtensionNames=[{42B5FAAE-6536-11D2-AE5A-0000F87571E3}{40B66650-4972-11D1-A7CA-0000F87571E3}] since it refers to the local script and how about the version on the gpt.ini file?
    Thanks in advance.
    Dash
    https://social.technet.microsoft.com/Forums/en-US/1f636042-bcff-498d-93c0-e1aa89f80961/how-to-load-a-script-on-the-local-group-policy-on-multiple-computers?forum=mdopagpm

  • How would you assign passwords in a script for a user

    How would i assign a password in script??

    the only way to "automate" password/user additions is to use expect - to allow you to input some meaningful password - stdin doesn't work too well as you've probably seen
    Alternatively you can find the crypted value for some password and use that in a cut and paste fashion into the /etc/shadow file (as root obviously) but there are some limitations...
    i.e.
    echo "${newuserid}:x:${uid}:${gid}:${GCOS}:${homedir}:${usershell}" >> /etc/passwd
    echo "${newuserid}:${cryptedpasswd}:0:7:90::::" >> /etc/shadow
    this means that you have basically one password you're assigning to each new user, which may or may not be what you're digging after.
    If you can figure out how to crypt the password (with the appropriate salt) so it fits into the /etc/shadow crypted format, you'd have your problem solved.

  • Gripes with Adobe scripting UI

    Spent a lot of time trying to get fillPath() to work in a UI.  Looked to be simple in the scripting guide but no luck.  The sample script colorselector.jsx with the Bridge SDK claimed to have paths used in it.  I couldn't find it.  Maybe Adobe can't get it to work either.  Tried a half-baked second approach to use a group and change the bg color.  My main intent is to create a visual model of a print with borders that can be adjusted with sliders for the user to get a good idea of that they're going to get.  Made a black group and a white group and got it to work in CS3.  Went to work and tried it on CS4 and it completely fell apart.  The stack order was different than CS3 and I could only get one color to show instead of the two I had in CS3.  Can't figure out why Adobe made this much of a change with the scripting to cause this much change.  We're having big issues with CS4 and custom XMP templates along with Flash extendscript interface due to some limit our company (I think) is placing on the use of ActiveX.  So as Adobe is moving more towards the use of Flash/flex with their other programs, this is causing problems in companies like mine that have tight controls on program interaction.
    Don't know if someone from Adobe actually reads these forums, but just want to vent and let them know that there maybe some bugs in their products.

    I agree that the Tools guide could be a lot more helpful than it is. Most of the time when I am trying something new with ScriptUI I end up going in hyperlink circles until I give up.
    And it doesn't help that once you do get something working in one version on one OS, it doesn't work the same in a different version or OS.
    colorselector.jsx is in both the ESTK and Bridge SDK. For what it's worth it seems to work the same in CS3 and CS4. Here is the CS3 version script. At a quick glance it is the same in the CS4 SDKs
    // ADOBE SYSTEMS INCORPORATED
    // Copyright 1998 - 2006 Adobe Systems Incorporated
    // All Rights Reserved
    // NOTICE:  Adobe permits you to use, modify, and distribute this file in accordance with the
    // terms of the Adobe license agreement accompanying it.  If you have received this file from a
    // source other than Adobe, then your use, modification, or distribution of it requires the prior
    // written permission of Adobe.
      @fileoverview Shows how to use graphic objects to customize the drawing of ScriptUI elements.
      @class Shows how to use graphic objects to customize the drawing of ScriptUI elements.
      <h4>Usage</h4>
      <ol>
      <li> Open this file and run it in the ExtendScript Toolkit.
           You can choose as the target any application that supports ScriptUI, although we recommend Adobe Bridge CS3.
      <li> Move the sliders up and down to change the color of the top panel.
      </ol>
      <h4>Description</h4>
    <p>Changes the colors of ScriptUI components dynamically, using the graphics customization objects.
       Displays sliders that allow the user to set the RGB components of a color, then
       creates new Pen and Brush types using those colors with methods of the ScriptUIGraphics objects
       associated with the window and panels.
    <p>To make the change in how the colors are drawn into the window on the screen, the example places the
       new Pen and Brush objects into the appropriate color properties of the graphics objects. The Pen is
       used to change the foreground, and the Brush is used to change the background.
    <p>Each Pen and Brush object is created with a brush type, a color value, and a line width.
      The color is given as an array of RGB values with a fourth number representing the Alpha
      channel (transparency) value.  The range for all values is 0 to 1.  
      For example, to set the background color of a window to a light grey:
    <pre>
    graphicsObject.backgroundColor = graphicsObject.newBrush (g.PenType.SOLID_COLOR, [0.75, 0.75, 0.75, 1], 1);
    </pre>
      See the JavaScript Tools Guide for more details.<br />
       @constructor Constructor
    function ColorSelector() { }
    <p>Functional part of this snippet, creates a Window and its ScriptUI components.
    Defines three panels: an instruction panel, a panel that displays the current
    color values, and a control panel.
    <p>The control panel contains radio buttons to choose the background or
    foreground, and sliders to choose new color values.  As the sliders move,
    their event handlers apply the new colors to the  background or foreground
    of the window. The event handlers use a helper function, changeColor(), which actually
    performs the color change, by creating Pen and Brush objects and using them to set
    the color properties of the graphics objects associated with the window and with
    each panel.
    @return True if the snippet ran as expected, false otherwise
    @type Boolean
    ColorSelector.prototype.run = function()
         $.writeln("About to run ColorSelector");
         // Construct the window and the components
         var win = new Window("window", "Color Selector", undefined, { resizeable: false });
         win.alignChildren = "fill";
         // The instructions panel - the text color of this panel will change
         var instPanel = win.add("panel", undefined, "Instructions");
         //instPanel.alignment = "fill";
         instPanel.alignChildren = "left";
         var st = instPanel.add("statictext", undefined, "", {multiline: true } );
         st.text = "Use the radio buttons to select either the forground or background.  Then adjust "
         + "the sliders in the bottom panel.  Each of the sliders represent a color, Red, Green or Blue.   "
         + "The values of the sliders are show in the 'Color Values' panel.\n\n"
         + "Using a Graphics Object you can:\n"
         + "*   Change the background color\n"
         + "*   Change the foreground color\n"
         + "*   Change individual elements or the entire window\n\n"
         + "This sample changes the colors within this panel.";
         st.characters = 50;
         // Panel to display the current color values
         var colPanel = win.add("panel", undefined, "Color Values");
         colPanel.orientation = "column";
         gp1 = colPanel.add("group");
         gp1.orientation = "row";
         gp1.add("statictext", undefined, "Red:");
         var RedText = gp1.add("edittext", undefined, "0.5000");
         gp1.add("statictext", undefined, "Green:");
         var GreenText = gp1.add("edittext", undefined, "0.5000");
         gp1.add("statictext", undefined, "Blue:");
         var BlueText = gp1.add("edittext", undefined, "0.5000");
         // Panel to control how the sliders move and to set the foreground/background
         var sliderPanel = win.add("panel", undefined, "Color Controls");
         sliderPanel.alignChildren = ["fill", "fill"];
         gp3 = sliderPanel.add("group");
         gp3.orientation = "row";
         gp3.alignment ="center";
         var foreBtn = gp3.add("radiobutton", undefined, "Foreground");
         var backBtn = gp3.add("radiobutton", undefined, "Background");
         var lockBtn = gp3.add("checkbox", undefined, "Lock Sliders");
         foreBtn.value = true;
         sliderRed = sliderPanel.add("slider", undefined, 5, 0, 10);
         sliderGreen = sliderPanel.add("slider", undefined, 5, 0, 10);
         sliderBlue = sliderPanel.add("slider", undefined, 5, 0, 10);
         // Handlers for sliders to capture changed values and apply colors
         sliderRed.onChanging = function()
              newVal = 0;
              if(sliderRed.value != 0)
                   newVal = sliderRed.value / 10;
              RedText.text = newVal;
              if(lockBtn.value)
                   sliderGreen.value = sliderBlue.value = this.value;
                   GreenText.text = BlueText.text = RedText.text;
              // apply color
              changeColor(1, newVal, foreBtn.value);
         sliderGreen.onChanging = function()
              newVal = 0;
              if(sliderGreen.value != 0)
                   newVal = sliderGreen.value / 10;
              GreenText.text = newVal;
              if(lockBtn.value)
                   sliderRed.value = sliderBlue.value = this.value;
                   BlueText.text = RedText.text = GreenText.text;
              // apply color
              changeColor(2, newVal, foreBtn.value);
         sliderBlue.onChanging = function()
              newVal = 0;
              if(sliderBlue.value != 0)
                   newVal = sliderBlue.value / 10;
              BlueText.text = newVal;
              if(lockBtn.value)
                   sliderGreen.value = sliderRed.value = this.value;
                   RedText.text = GreenText.text = BlueText.text;
              // apply color
              changeColor(3, newVal, foreBtn.value);
         win.show();
         // Apply the color changes to the window and panels
         function changeColor(color, val, foreground)
              try
                   var Red = parseFloat(RedText.text);
                   var Green = parseFloat(GreenText.text);
                   var Blue = parseFloat(BlueText.text);
                   switch(color)
                        case 1:
                             Red = val;
                             break;
                        case 2:
                             Green = val;
                             break;
                        case 3:
                             Blue = val;
                             break;
                        default:
                             return;     
                   // Colors: Red, Green, Blue, Alpha
                   var colArr = [Red, Green, Blue, 1];
                   // Get ScriptUIGraphics object associated with the window and each panel
                   var g = win.graphics;
                   var g2 = sliderPanel.graphics;
                   var g3 = colPanel.graphics;
                   var c, c2, c3;
                   if(foreground)      // do the foreground
                        // Create a Pen object for each color
                        // specifying type, color, linewidth
                        c  = g.newPen (g.PenType.SOLID_COLOR, colArr, 1);
                        c2  = g2.newPen (g2.PenType.SOLID_COLOR, [0, 0, 0, 1], 1);
                        c3  = g3.newPen (g3.PenType.SOLID_COLOR, [0, 0, 0, 1], 1);
                        // Set the new Pen object as the foregroundColor of the graphics objects
                        g.foregroundColor = c;
                        g2.foregroundColor = c2;
                        g3.foregroundColor = c3;
                   else // do the background
                        // Create a Brush object for each color
                        // specifying type, color, linewidth
                        c  = g.newBrush (g.BrushType.SOLID_COLOR, colArr, 1);
                        if(File.fs == "Windows")
                             defColor = [0.933, 0.918, 0.848, 1];
                        else
                             defColor = [0.949, 0.949, 0.949, 1];
                        c2  = g2.newBrush (g2.BrushType.SOLID_COLOR, defColor, 1);
                        c3  = g3.newBrush (g3.BrushType.SOLID_COLOR, defColor, 1);
                        // Set the new Brush object as the backgroundColor of the graphics objects
                        g.backgroundColor = c;
                        g2.backgroundColor = c2;
                        g3.backgroundColor = c3;
              catch(error){ alert(error); }
         $.writeln("Ran ColorSelector");
         return true;
    "main program": construct an anonymous instance and run it
      as long as we are not unit-testing this snippet.
    if(typeof(ColorSelector_unitTest ) == "undefined") {
         new ColorSelector().run();

  • Can anyone help with the scripting on this file?

    Hi, I hope someone with a bigger brain can help me out here.
    I've got an existing Flash CS3 file that makes up the result at http://www.infusion-set.com/flash/Elearning/Inset30/inset30_eguide.html.
    The client has asked if I could add an extra tab at the top after 'Reconnecting' called 'Contact Us' with link to an extra page. All the design has been done in ActionScript 2 with references to XML files for the dynamic content because it's been done in other languages as well.
    I've amended the existing XML file with the correct references for a new page and an accompanying .swf file to play in the animation area.
    I've attempted a .fla version where I duplicated one of the existing tabs script, changed the XML references and changed the variables where necessary to 'con or 'Con' (representing Contact Us). Unfortunately it made the tab menu go completely off the page and was obviously wrong in some way.
    Can anyone give me a clue as to what to change here on the original file as I'm a bit of a novice with ActionScripts, hence me asking.
    For reference I've attached HTML files with the original file scripts and my incorrect version. The  timeline is 103 frames with the scripts placed at frame 1 and 102
    Thanks.
    Garry

    The buttons are all created using the same library object (but MC), except for the code you have in the revised file does not call on that for the con button.
    You have it calling on something with a linkage name of "con", which a quick check tells me doesn't exist--so it is undefined in the code when you try to use it.  I found this by using trace(newConBut._x); after its _x value was assigned, as I mentioned you should try.   So the first thing you want to do is change the following line from...
    var newConBut = _root.attachMovie("con", "conbut", _root.getNextHighestDepth());
    To
    var newConBut = _root.attachMovie("but", "conbut", _root.getNextHighestDepth());
    so that it uses the but MC that serves that purpose in the library.  Then you want to correct the _x assignment of the buttons to what I think you had earlier...
    newConBut._x = 650-newConBut._width;
    newRecBut._x = newConBut._x-newRecBut._width;
    Here is a picture of what those changes do (note, without the XML file I had to finagle things just to work, so the biutton labels aren't what they will be)...

  • Assign Units To Calculated Key Figures

    Hi All,
    I have few calculated key figures which gives cycle time in hrs. So i want to assign Hr as the unit to this calculated key figure explicitly.
    Or in case of a computation which results in distance, KM should be assigned.
    Can someone guide me as to how can i assign a unit to a calculated key figure.
    Regards,
    Charu

    Hi,
    give Units in Descrition of CKF. or you have to create keyfigure and maintain units for that one at the infoprovider level and calculation you can do at infoprovider or in CKF (but see that 2 keyfugures with units will not be there, in that case suppress one keyfigure unit with NODIM function in CKF)
    Regards
    Daya Sagar

  • Error message with a script sending emails to multiple recipients.

    Hi all,
    I am very new with powershell scripting and I want to request your attention and help on this issue.
    I am getting this error message "Send-MailMessage: An invalid character was found in the mail header: ','" given by this script:
    Param (
    [string]$Path = "C:\Temp\",
    [string]$SMTPServer = "smtp.domain1.com",
    [string]$From = "[email protected]",
    [string[]]$To = "[email protected],[email protected]",
    [string]$Subject = "New backup file"
    $SMTPMessage = @{
    To = $To
    From = $From
    Subject = "$Subject at $Path"
    Smtpserver = $SMTPServer
    $File = Get-ChildItem $Path | Where { $_.LastWriteTime -ge [datetime]::Now.AddHours(-6) }
    If ($File)
    { $SMTPBody = "`nThe following files have recently been added/changed:`n`n"
    $File | ForEach { $SMTPBody += "$($_.FullName)`n" }
    Send-MailMessage @SMTPMessage -Body $SMTPBody
    I found the ForEach() approach but when I put it inside I get an infinite loop.
    Many thanks for any suggestions

    [string[]]$To = "[email protected],[email protected]",
    should be
    [string[]]$To = @("[email protected]","[email protected]")

Maybe you are looking for