How to create a script that selects a random sample?

My idea is... instead of using mathematics to create a random number rgb I want to choose a specific color to hex or RGB and assign a number from 1 to 10 then use random() to choose a random number between 1 and 10 to choose one of these colors and place as foreground color. I don't know enough JavaScript to create this script. Thank you

Does that help?

2014, use it at your own risk.

#target photoshop - 70.032

set up colors.

var theArray =]

[0,0,0],

[255,0,0],

[0,255,0],

[0,0,255],

[255,255,255],

];

Select the color;

var thisColor = theArray [Math.floor (Math.random () * (theArray.length))];

do forground color.

var theColor = new SolidColor();

theColor.rgb.red = thisColor [0];

theColor.rgb.green = thisColor [1];

theColor.rgb.blue = thisColor [2];

app.foregroundColor = theColor;

Tags: Photoshop

Similar Questions

  • Trying to create a script that lists all clusters in a data center

    Hello

    I am trying to create a script that exports a vCenter configuration essentially and imports it in a new vCenter. I want the script to run without specifying a center of data manually. All the scripts I've seen you need to manually enter the data center.

    So, how to do a list of all the data centers with clusters in each of them? I also want to create a variable that contains the groups for the respective data centers. Here's a basic idea of what I want to do:

    $Datacenters = get-data center

    foreach ($Datacenter to $Datacenters)

    {

    $cluster = get-Cluster-location $Datacenter

    Write-Host "list of clusters in $Datacenters.

    Write-Host "$Cluster".

    }

    Who will give me the output like this:

    List cluster Datacenter1

    cluster2 CLUSTER1

    List cluster Datacenter2

    cluster3 cluster4

    But I don't know how I can get so I have variable like this:

    $datacenter1 = cluster1, cluster2

    $datacenter2 = cluster3, cluster4

    Did you mean something like this?

    Get-data center | %{

    New-Variable - Name $_. Name - value ([string]: join ("," (Get-Cluster-location $_ | % {$_.}))) Name})))

    }

  • How to create the script to compile procedure files in oracle - urgent deadline...

    How to create the script to compile procedure files in oracle.    about to go live and have much .prc pkg in a directory usr/tmp/ar... Po... human resources etc. need to create a script to compile all the files in the folder, then do not open all necessary .prc suggestions on how to do it.   Thank you Tom.

    (1) an urgent need, ASAP,... are words that do not in a forum of volunteer. We are here to help if you need it now, for free, open a SR.

    (2) oracle procedures are not files.

    (3) I think you are trying to run operating system packages, no Oracle procedure. right?

  • How to create a script for the calculation of the VO2max using text on a pdf form field values.

    I'm trying to create a script that calculates the VO2max based on user input in several text fields.

    My form is set up so that the user can enter values in the 4 fields of text:

    1 weight = weight in kilograms

    2. age = age in years

    3 time = time to walk 1 mile in decimal

    4. the heart rate (HR) = heart rate recovery immediately after you have finished walking 1 mile

    The VO2max equation that I use is:

    VO2max = 132.853 - (0.1692 * weight)-(0.3877 * Age) + (6,315) - (3.2649 * time)-(0.1565 * HR)

    After the user enters values in 4 text fields, I want the text of VO2max field automatically calculate the above equation and display the result to the user so that the user doesn't have to get all those numbers into a calculator.

    Any suggestions on how to write the script?

    Assuming that your domain names are what you entered in the formula, you can use the simplified field notation:

    132.853 - (0.1692 * weight)-(0.3877 * Age) + (6,315) - (3.2649 * time)-(0.1565 * HR)

    If you want the value to display only after al the data fields are complete you need to use a JavaScript calculation:

    function GetField (cName) {}
    oField var = this.getField (cName);
    if(oField == null) app.alert ("field of error for access to the" cName + "\nPlease verify the name of the field.", 1, 0 ");
    return oField;
    }

    var weight = GetField ("Weight");
    var Age is GetField ("Age");.
    var time = GetField ("Time");
    var h = GetField ("HR");

    Event.Value = "";
    If (Weight.value! = 0 & Age.value! = 0 & Time.value! = 0 & HR.value! = 0) {}
    Event.Value = 132.853 - (0.1692 * Weight.value)-(0.3877 * Age.value) + (6,315) - (3.2649 * Time.value)-(0.1565 * HR.value);
    }

  • How to create a script for the name of the channel to take and insert text on profile in CS5

    I am a silkscreen and I print my Photoshop starts. I regularly work with multi channel files or RGB files with additional color channels. I created actions to place check marks, resize images, etc. to be ready to print manually but I create for each display text labels, if they are absent from the original work.


    The files I work with have named pipes as "basic white, red, green, blue 284" etc. which indicates the color of the ink. I want to be able to do is create a script that copies the text of the channel name and insert it into a separate or each/all channels to the top of the file, so that when I print every positive there is a label corresponding to the color of the ink.


    I don't know if this is even possible, and I am limited in my knowledge when it comes stock and no experience with scripting and have had pretty good luck in the past for actions to do what I want without unnecessary steps.


    On my target action registration, it creates a new channel with each individual reg mark then combined in a separate channel in which I just copy the contents and select all channels of ink and fill with black to make them appear, I am happy with the steps that must be that it is not too complicated and if it could do the same with labels I would be happy with that.


    Thanks in advance!

    Something like that?

    // the color used for the text
    var black = new SolidColor();
    black.rgb.hexValue = '000000';
    // set this to space the labels
    var horizontalOffest = new UnitValue(20,'pt');
    var doc = app.activeDocument;
    var currentLayer = doc.activeLayer;
    var textLayer = doc.artLayers.add();
    textLayer.kind = LayerKind.TEXT;
    // font requires the postscript name of the font
    textLayer.font = "ArialMT";
    textLayer.textItem.size = new UnitValue(9,'pt');
    textLayer.textItem.justification = Justification.RIGHT;
    // set the position for the text. this sets to top right corner of the channel
    // here it is set so the text baseline ends  40pts from the right edge, 15pts down
    textLayer.textItem.position = [new UnitValue(doc.width.as('pt')-50,'pt'),new UnitValue(15,'pt')];
    textLayer.textItem.contents = 'label';// temp label string
    
    for(var channelIndex = 0; channelIndex		   
  • How to create a script which gives all depedencies an object in 11g

    How to create a script which gives all depedencies an object in 11g

    You can use dba_dependencies for this... go through the manual.

    I don't know in this thread, someone will come up with the query for you, but there is another approach is:

    in sqlplus:

    SET SERVEROUTPUT ON SIZE 1000000
    EXEC  dbms_utility. get_dependency ('TABLE','SCOTT','EMP');   -- object_type,user,tablename as parameters
    

    See you soon,.
    Manik.

  • Active script that selects all of the items spread

    I'm trying to find a 'simple' script that selects all elements on the page, either a group or individual items without using a dialog window. Is there a selection simple javascript to select all the objects on a page or spread for InDesign CS3? I'm new to this sort of thing script.

    Hey!

    PankChat is right, but you can't 'see' the selection.

    If you want to 'see' what is selected, try this:

    app.select(app.activeWindow.activePage.allPageItems);
    

    tomaxxi

  • How to create a form that requires thousands of boxes?

    Hello forum members

    I have Adobe Acrobat 8 Professional.  I searched the internet and forums for the last few hours and I can't seem to find information on how to create a form with multiple check boxes.  I don't want to give individual names to thousands of boxes.  I am hoping there is a simple solution to my problem.  Maybe don't even need to use checkboxes.

    Here it is...

    I'm a DJ and the wedding season is coming.  For every wedding that I do, I usually give the bride and groom a list of my songs and they choose a bunch of songs they would like to have at their reception.  In the past, I've just been sent word to Web page with songs and they would send me their selections in another document or directly in the email response.  I want to make this process easy for them (and me) in a pdf document where they can simply place a check mark next to the songs they want and then send it to me.  Premium (if possible) I would like to be able to export the songs they have selected in a separate document so that I don't have to go through the full pdf (with thousands and thousands of songs) when they send it to me.

    I would be forever grateful if someone help me or direct me to a link with additional information.

    Thanks in advance,

    Mike

    Probably the best thing to do is to have Acrobat automatically adds checkboxes for you. It would take to add a box character by using a font such as Wingdings next to each song title. When you select "forms > run form field recognition", it detects each box on every page and add the checkbox fields.

    You need to activate the reader of the document (Advanced > user rights enable in Adobe Reader) so that users can save the completed form.

    Once you receive it back, you can run a script to create a list of selected songs. Exactly how do you it depends on indications of the final form that you create.

  • How to create a polygon that covers a set of geometries?

    Hi people,

    I have a spatial table with the parcel data. Some are polygons and lines.
    What I have to do is to create a single polygon that covers all these plots.
    I tried some spatial functions, but the result is not perfect.
    Could you guys give some advice on how to do it using the Oracle Spatial functions?

    Thank you
    Luis

    Luis etc.,

    Delicate using the ST_PolygonBuilder (JTS) that implements my code SC4O Java-in-the-database and some coding, I managed to product a polygon that covers the data correctly.

    Note that I use only external linestrings which provides some Luis.

    -- First create a table holding only the outer lines.
    --
    create table outerLines as
      SELECT SDO_GEOMETRY(2002, 8292, NULL, SDO_ELEM_INFO_ARRAY(1,2,1), SDO_ORDINATE_ARRAY(-49.6878936628642, -18.4995538840232, -49.6875224063873, -18.4994400734344, -49.6882811644211, -18.4960292763006, -49.6886251490431, -18.4958803030445, -49.6906307026931, -18.4950115281619)) as geom from dual union all
      SELECT SDO_GEOMETRY(2002, 8292, NULL, SDO_ELEM_INFO_ARRAY(1,2,1), SDO_ORDINATE_ARRAY(-49.6884083531774, -18.4917625230274, -49.6886528151554, -18.4922451253898, -49.6898503241639, -18.4946091658756, -49.690098431643, -18.4950991112698, -49.6902068702432, -18.4950498009285, -49.6905958643821, -18.4948724904445)) as geom from dual union all
      SELECT SDO_GEOMETRY(2002, 8292, NULL, SDO_ELEM_INFO_ARRAY(1,2,1), SDO_ORDINATE_ARRAY(-49.6883413960309, -18.4918992292229, -49.6885491287687, -18.4923048595269, -49.6849860033691, -18.4934740072225, -49.6855427926656, -18.4945793006294, -49.6857982402423, -18.4950861997106, -49.6860079716291, -18.4955025995491, -49.6836133980005, -18.4962994912622, -49.6834396716227, -18.4957578264012)) as geom from dual union all
      SELECT SDO_GEOMETRY(2002, 8292, NULL, SDO_ELEM_INFO_ARRAY(1,2,1), SDO_ORDINATE_ARRAY(-49.6792385551751, -18.5000418095053, -49.6797119992317, -18.4998345697814, -49.6783397446724, -18.4980535328215, -49.6810365599698, -18.4971609552001, -49.6810385833744, -18.4971564511947, -49.6835051531636, -18.4963355157698, -49.6833312619652, -18.4958030666281)) as geom from dual union all
      SELECT SDO_GEOMETRY(2002, 8292, NULL, SDO_ELEM_INFO_ARRAY(1,2,1), SDO_ORDINATE_ARRAY(-49.6878678853177, -18.4996181336176, -49.6861731626715, -18.4991017919552, -49.6834080082784, -18.4982775371379, -49.6833583465082, -18.4983066497055, -49.6832975737928, -18.4983520405102, -49.6831594052426, -18.4984987309426, -49.6830586383606, -18.4986094463067, -49.6829994956301, -18.4986769870823, -49.6829194669485, -18.4987385992949, -49.6828337343539, -18.4987905933782, -49.6827167582476, -18.4988411048671, -49.6825978712605, -18.4988566328165, -49.6824876108137, -18.4988587567866, -49.6824343436196, -18.4988638980162, -49.6823495710101, -18.498901802054, -49.6820036074112, -18.4990727977958, -49.6815739264209, -18.4993045655044, -49.6815394467332, -18.4993194542279, -49.6815037571481, -18.4993313944568, -49.681467095582, -18.4993402576461, -49.6814297528519, -18.4993459734892, -49.6813920251781, -18.4993484966453, -49.6813542118344, -18.4993478070996, -49.6813166127745, -18.4993439103221, -49.6812795262518, -18.4993368372241, -49.6812432464542, -18.4993266439127, -49.6812080820875, -18.4993134018902, -49.6793284309429, -18.5001537628556)) as geom from dual;
    
    -- Firstly, fill in the gaps between all the outer lines by generating small 2 point linestrings....
    -- This is what the CTE, connected_lines, produces
    --
    with connected_lines as (
    select row_number() over (order by 1) as rid,
           f.geom
      from (select sdo_geometry(2002,8292,null,sdo_elem_info_array(1,2,1),sdo_ordinate_array(sx,sy,ex,ey)) as geom
              from (select distinct sx,sy,ex,ey,dist,
                           min(dist) over (partition by sx,sy) as mdist
                      from (select a.x as sx,a.y as sy,b.x as ex,b.y as ey,
                                   sdo_geom.sdo_distance(sdo_geometry(2001,8292,sdo_point_type(a.x,a.y,null),null,null),
                                                         sdo_geometry(2001,8292,sdo_point_type(b.x,b.y,null),null,null),
                                                         0.005) as dist
                              from (select p.x as x, p.y as y
                                      from outerLines g,
                                           table(geom.getVector(g.geom)) v,
                                           table(geom.getPointSet(v.AsSdoGeometry(8292))) p
                                    group by p.x, p.y
                                    having count(*) = 1
                                   ) a,
                                   (select p.x as x, p.y as y
                                      from outerLines g,
                                           table(geom.getVector(g.geom)) v,
                                           table(geom.getPointSet(v.AsSdoGeometry(8292))) p
                                    group by p.x, p.y
                                    having count(*) = 1
                                   ) b
                              where a.x != b.x and a.y != b.y
                            )
                    )
                    where dist = mdist
            UNION ALL
            select g.geom
              from outerLines g
          ) f
    )
    /* Now ask SC4O's ST_PolygonBuilder to try and create a polygon from the set of lines */
    select sc4o.ST_PolygonBuilder(CAST(COLLECT(f.geom) as mdsys.sdo_geometry_array),8) as polygon
      from ( /* Now, the WITH connected_lines produces 2 copies of each linestring with the coordinates reversed.
                    These have to be removed/de-duped before being passed into the ST_PolygonBuilder */
            select sdo_geometry(2002,8292,null,sdo_elem_info_array(1,2,1),sdo_ordinate_array(sum(x1),sum(y1),sum(x2),sum(y2))) as geom
              from (SELECT rid,
                           case when rid=NVL((lag(rid,1) over (partition by rid order by x)),rid)
                                then case when vertexId = 1 then x else null end
                            end as x1,
                           case when rid=NVL((lag(rid,1) over (partition by rid order by x)),rid)
                                then case when vertexId = 1 then y else null end
                            end as y1,
                           case when rid=NVL((lag(rid,1) over (partition by rid order by x)),rid)
                                then case when vertexId = 2 then x else null end
                            end as x2,
                           case when rid=NVL((lag(rid,1) over (partition by rid order by x)),rid)
                                then case when vertexId = 2 then y else null end
                            end as y2
                    FROM   (select rid,
                                   row_number() over (partition by rid order by x) as vertexId,
                                   x, y
                              from (select min(m.rid) rid,
                                           t.x, t.y
                                      from connected_lines m,
                                           table(sdo_util.getVertices(m.geom)) t
                                     where sdo_util.GetNumVertices(m.geom) = 2
                                     group by t.x,t.y
                                     order by t.x )
                           )
                      )
                    group by rid
        union all
        /* Select and pass into ST_PolygonBuilder the original outer lines */
        select m.geom as geom
          from connected_lines m
         where sdo_util.GetNumVertices(m.geom) > 2
        ) f;
    -- Result
    --
    POLYGON
    -----------------------
    MDSYS.SDO_GEOMETRY(2003,8292,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),MDSYS.SDO_ORDINATE_ARRAY(-49.6906307026931,-18.4950115281619,-49.6886251490431,-18.4958803030445,-49.6882811644211,-18.4960292763006,-49.6875224063873,-18.4994400734344,-49.6878936628642,-18.4995538840232,-49.6878678853177,-18.4996181336176,-49.6861731626715,-18.4991017919552,-49.6834080082784,-18.4982775371379,-49.6833583465082,-18.4983066497055,-49.6832975737928,-18.4983520405102,-49.6831594052426,-18.4984987309426,-49.6830586383606,-18.4986094463067,-49.6829994956301,-18.4986769870823,-49.6829194669485,-18.4987385992949,-49.6828337343539,-18.4987905933782,-49.6827167582476,-18.4988411048671,-49.6825978712605,-18.4988566328165,-49.6824876108137,-18.4988587567866,-49.6824343436196,-18.4988638980162,-49.6823495710101,-18.498901802054,-49.6820036074112,-18.4990727977958,-49.6815739264209,-18.4993045655044,-49.6815394467332,-18.4993194542279,-49.6815037571481,-18.4993313944568,-49.681467095582,-18.4993402576461,-49.6814297528519,-18.4993459734892,-49.6813920251781,-18.4993484966453,-49.6813542118344,-18.4993478070996,-49.6813166127745,-18.4993439103221,-49.6812795262518,-18.4993368372241,-49.6812432464542,-18.4993266439127,-49.6812080820875,-18.4993134018902,-49.6793284309429,-18.5001537628556,-49.6792385551751,-18.5000418095053,-49.6797119992317,-18.4998345697814,-49.6783397446724,-18.4980535328215,-49.6810365599698,-18.4971609552001,-49.6810385833744,-18.4971564511947,-49.6835051531636,-18.4963355157698,-49.6833312619652,-18.4958030666281,-49.6834396716227,-18.4957578264012,-49.6836133980005,-18.4962994912622,-49.6860079716291,-18.4955025995491,-49.6857982402423,-18.4950861997106,-49.6855427926656,-18.4945793006294,-49.6849860033691,-18.4934740072225,-49.6885491287687,-18.4923048595269,-49.6883413960309,-18.4918992292229,-49.6884083531774,-18.4917625230274,-49.6886528151554,-18.4922451253898,-49.6898503241639,-18.4946091658756,-49.690098431643,-18.4950991112698,-49.6902068702432,-18.4950498009285,-49.6905958643821,-18.4948724904445,-49.6906307026931,-18.4950115281619))
    

    The result is a nice clean polygon.

    http://www.spatialdbadvisor.com/files/PolygonCoveringGeometrySet.PNG

    This, more than my last post is the best I can do. It took me many, many hours to implement. Please allow points since it is a correct result. Also, consider making a PayPal donation on my Web site for the hours I spent.

    NOTE: The package space companion 4 Oracle (SC4O) is available for download FREE on my site. Again, donations accepted if the code made what you want.

    concerning
    Simon

    Published by: Simon Greener on April 11, 2013 09:53 Changed where a.x, b.x and b.y-a.y etc. to where a.x! = b.x and a.y! b.y =

  • How to create a value to select all the dashboard command prompt values

    Dear Sir/Madam,
    OBIEE version is 10g.
    I create a dashboard promt to act as a filter option. It includes all the values in the target column. I wonder how to add value to this prompt to select all of the values in this column?

    For example:
    Table has a column 'product '. Total of 3 values in this column: "product produced b","", "product c '. When I create a dashboard command prompt to include all the choice of 'product '.
    Show sql result: I press "select A product".
    Ok. This message now includes "product produced b","", "product c ' fall down meun. But the problem also. If the user wants to choose all the values in this column? How he/she can do that? I would also add a value 'All products' to include ' product produced b "," "," product c "drop menu drop-down. If the user choose this option. Displays all the results of the product?
    Thank you.

    June wrote:
    I'm sorry that I have no idea about this idea.
    Do you mean the dash prompt has a functional to the list of the values of all options as check boxes? Please would you give me a simple example if you are convenient?
    Thanks anyway.

    When you create the dashboard, as David T say, simply leave the values at all rather than send the SQL query. This will give you the list of all values for the prompt. When the user wants to run the report with all values, it will need check all the boxes in the list, to get the report with all products.

    Kind regards
    -Laurence.

  • Looking for how to create a page that will recreate self-esteem and image uploader!

    Greetings,

    Is one know how I can create client-side page that would always recreate yourself when a new customer registers and become a member on my blog site, so that they could manage and add friends to their page and download the image to their album? The idea is to have pages added as if it were on Facebook, when a member signs up.

    If I have software server-side is necessary to achieve this goal; What kind of software on the server side need me for this design? Please contact me if you have an idea.

    I would also like to receive information on where to find the script that helps visitors to upload images to my site.

    I did it with other parts of my web design adding that this idea is what I need to finish. Your help is greatly appreciated.

    Joplateau.

    You can ask in a forum more generalized as http://forums.adobe.com/community/design_development/webdesign. It is designed for Adobe Contribute (which will not do what you want) and is rarely visited. Good luck.

  • How to create Radio button that works like a Menu of rerouting

    Hi all

    Thanks in advanced for any help you can offer!

    I need assistance with Javascript that will dynamically created radio buttons act like the Menu for rerouting.

    Help, please. I need it as soon as POSSIBLE.

    I currently use several shortcuts menu (in Dreamweaver) to refresh the screen and additional Jump Menu on the screen. So that a user selects in the menu dropdown will refresh the page and update the content by following Menu go. I use Coldfusion for popular information. I use the URL to see the VARIABLES each refresh of the screen.

    Example URL: http://www.haysfluidcontrols.com/haysfluidcontrols/onlinecat/HoseKits.cfm

    ALSO, if any buddy knows how to create a Coldfusion page like this which are NOT REFRESHED when each choice, I'd LOVE to hear about it. I know of AJAX, but have not found anything made since then and have not been able to understand how incorperate it into my code.

    Thanks again,
    Matt

    Thanks for the comments everyone. I came up with a great solution. Thanks to Phil Hegedusich Direction. I am including my solution in this post. I also noticed that this code works with checkboxes.

    Thanks again for the help. I hope this helps others.

  • How to create a folder that is NOT a SMART FOLDER?

    (1) how can I create a folder that is NOT a smart folder?

    (2) how can I get a folder to display the NUMBER of items it contains?

    https://support.Apple.com/kb/PH22185?viewlocale=en_US & local = en_US click the blue details.   It's Apple records guide.

  • How to create a task that runs once a day, immediately after the opening of session?

    Hello, I'm wondering how to create a task using the Task Scheduler that runs once a day, immediately after I have logon.

    The reason is I want to use Bing Desktop to change my wallpaper every day. However, I just want to run the first time I start my computer every day, so it will change the wallpaper. By default, it starts whenever I have to logon. It's annoying, because I just want it to start once a day to change the wallpaper. However, using the Task Scheduler, I put only a trigger to start "at the opening of session' or"once a day." If I choose once per day, it runs about 5-10 min after I login, instead of logon immediately after. If I choose the two triggers, then it starts after each session.

    Basically, I just want the Task Scheduler to launch the program after the connection the first time I connect to the computer on any given day. How can I do this?

    Hello Jeffrey,.

    You can refer to the links below and see if that helps.

    Create a task

    http://TechNet.Microsoft.com/en-us/library/cc720110 (v = WS.10) .aspx

    Modify a scheduled task

    http://TechNet.Microsoft.com/en-us/library/cc778308 (v = WS.10) .aspx

    Change an existing task

    http://TechNet.Microsoft.com/en-us/library/cc766442.aspx

    Please write back to us for assistance and we will be happy to help you come.

    Thank you

  • Windows Live Mail 2011 - how to create a Signature that contains a hyperlink to the address of my website?

    In Windows Live Mail 2011, I am trying to create a Signature that contains a hyperlink to my website address.

    I click on Options - Mail - Signatures - new.

    If I choose 'text' - there is no way to add a hyperlink.

    If I choose "files, browse" do I look for? I'm supposed to be creating an HTML document to the address of the site? and if yes, how do I do that?

    You'll get better help at Windows Live Mail Solution Center - Forum

    [See also

    Windows Live Help Center, Windows Live Mail, Windows Live Hotmail]

Maybe you are looking for