Can a script to randomly select an action within a specific set for use on multiple images?

Hello.

I have a file of 200 + similar images (taken in a photo booth).

I did 8 separate actions within the same series are slightly different textures for an image. Actions are labeled 1, 2, 3... etc.

I am wanting a way to get all the images to have a (randomly chosen) actions applied to them.

I'm pretty confident that this was possible with scripts, but have no idea how write a.

If the images were sequecnially applied to action 1 then 2, then 3 and so on (repeat when 8) this would also agree.

I am fairly new to scripting so please keep the answers simple if possible.

Thank you very much.

Wil Stevens

Something like that?

// make variable to hold the name of the action set
var actionSet = "myActionSet";
// make variable to hold an array of action names you want to use from that set
var actionArray = ["Action 1","Action 2","Action 3","Action 4","Action 5","Action 6","Action 7","Action 8"];
// either hard code the folder path
// var sourceFolder = new Folder('~/desktop/booth');
// or prompt for folder
var sourceFolder = Folder.selectDialog("Select the booth pix folder");
// if prompting user make sure they didn't cancel the dialog without selecting a folder
if(sourceFolder != null ) {
    // make variable for processed folder
    var processedFolder = new Folder(sourceFolder+'/processed');
    // make sure it exists
    if(!processedFolder.exists) processedFolder.create();
    // get the files from the folder using a mask to only get certain file extensions
    var files = sourceFolder.getFiles(/\.jpg$/i);// here we are only getting jpeg files with .jpg or .JPG extension
    // now loop through the files and apply random action
    for(var f=0;f 
         

Tags: Photoshop

Similar Questions

  • a script of random generation of positioning within a specific area

    I'm creating a series of online festive banners that have a timeline controlled by AS2 (everything very basic - simple fade and go to the next section). I have from a random generation script to produce an effect of flicker on a stretch of the banner, but I wish that the sparks don't appear that in a specific area of the banner, but used _x, FLF, positioning of the controls do not seem to function as you can see below, I managed to limit, in that they appear but as I said is not the positioning of them.  My knowledge IS limited so I'am wrong - code for the random generator is below

    var numOfSparkles:Number = 10;

    var fadeAmount:Number;

    function attachSparkel() {}

    var t: MovieClip = _root.attachMovie ("sparkle", "sparkle" + _root.getNextHighestDepth (), _root.getNextHighestDepth ());

    t._x = Math.floor (Math.random () *(310-t._width));  / * area * /.

    t._y = Math.floor (Math.random () *(82-t._height));  / * area * /.

    t._xscale = t._yscale is Math.floor (Math.random () * 50) + 80.;

    t.fadeAmount = Math.ceil (Math.random () * 15); / * fade speed * /.

    t.onEnterFrame = function() {}

    This ._alpha = this.fadeAmount;

    If (this ._alpha < = 0) {}

    delete this.onEnterFrame;

    attachSparkel();

    }

    };

    }

    for (i = 0; i < numOfSparkles; i ++) {}

    attachSparkel();

    }

    If you must limit the spark of a more specific area then you must identify the minimum from value and the additional random value is added to the...

    var xmin = 0;

    var xmax = 310;

    var ymin = 0;

    var ymax = 82;

    t._x = xmin + Math.floor (Math.random () * (xmax - xmin - t._width));  / * area * /.

    t._y = ymin - Math.floor (Math.random () * (ymax - ymin - t._height));  / * area * /.

    The code just show will duplicate what you have already until you change the values of the min/max variables.

    [edited on behalf of 4th OK variable - is wrong to repeat "xmax"]

  • How can I create a network and put in on my iphone 4S for use with wifi?

    I have a phone, a personal hot spot 4s, a router and a broadband cable. Everything is running but I can't figure out how to get my network on my iPhone for use with Wifi.  Also, I don't know how or where on the phone to set the password and since I don't have a different password, I can't use my wifi?  Help, please!  My iPhone tech is exhausted and I'm going against a brick wall with my internet service who refuses to provide me with their ISP, etc.

    Hello

    Please ask your question the following support forums.

    iPhone: Apple Support communities:
    https://discussions.Apple.com/community/iPhone?CategoryID=201

    Concerning

  • random selection of action script

    Hello

    I've done 10 things with the brush definitions. I need a script for performing random action (instead of their execution on the Panel shares) if possible. Can someone show me how do or post a final example here?

    I have very low knowledge for the script, please be gentle with me.

    Thank you for your kindness,

    Nick

    This version requires that you change the variable based on your name of LayerSet.

    #target photoshop;
    if(documents.length){
        main();
        }else{
            alert("You need a document open to run this script!");
            }
    function main(){
    //////////////////////////////////////////////////////////////////////
    // Change "Default Actions" to the name of your LayerSet
    var ASname = "Default Actions";
    /////////////////////////////////////////////////////////////////////
    if(!checkActionExists(ASname.toString())) {
        alert("\"" +ASname+ "\"" + " does not exist!\nPlease check your spelling\nIt is case sensitive!")
        return;
        }
    var ActionSets =getActionSets();
    for(var a in ActionSets){
        if(ActionSets[a].toString() == ASname.toString()){
            var Actions = getActions(ActionSets[a].toString());
            var RA = Actions[Math.floor(Math.random() * Actions.length)];
            try{
            app.doAction(RA.toString(), ASname.toString());
            }catch(e){};
            break;
            }
    }
    };
    function checkActionExists( setName, actionName ){
       var res = false;
       try{
          var ref = new ActionReference();
                if(actionName != undefined){
          ref.putName( charIDToTypeID( 'Actn' ), actionName );
          }
          ref.putName( charIDToTypeID( "ASet" ), setName );
          executeActionGet( ref );
          res = true;
       }catch(e){return false}
       return res;
    };
    function getActionSets(){
    var aSets=[];
    var z = 1;
    while(true){
    var ref = new ActionReference();
    ref.putIndex(charIDToTypeID('ASet'), z);
    try{
    var desc = executeActionGet(ref);
    var actName = desc.getString(charIDToTypeID('Nm  '));
    aSets.push(actName);
    z++;
    }catch(e){return aSets;}
        }
    };
    function getActions(aSet){
    var names = [];
    var z =1;
    while(true){
    var ref = new ActionReference();
    ref.putIndex(charIDToTypeID('Actn'), z);
    ref.putName(charIDToTypeID('ASet'), aSet);
    try{
    var adesc = executeActionGet(ref);
    var actName = adesc.getString(charIDToTypeID('Nm  '));
    names.push(actName);
    z++;
    }catch(e){return names;}
        }
    };
    
  • How can I change the parameters of the actions within a function using the different function

    Can not think of another way to ask, I have looked EVERYWHERE and tried to do my best of my knowledge, but no luck.
    Suppose I got 10 squares respectfully named sq1, sq2... sq10 and I have a 10 button that, when you press on, calls a function that makes his respectful place move and changes color. This would be a problem if she had only 10 squares and just do 2 actions, simply change the name of the instance of each function... something like:

    Button1.onPress = movesquare1 ();

    Button2.onPress = movesquare2();

    ... and so on

    function movesquare1 ();

    SQ1._x = sq._x + 1;

    function movesquare2 ();

    SQ2._x = sq._x + 1;

    ... and so on

    is it possible to have a function General movesquare, designate a variable N so that when a button is pressed the N variable would be designated?

    something like:

    Button1.onPress = movesquare (n = 1)

    function movesquare ();

    SQN._x = sqn._x + 1;

    This way I don't that the change in n = 1 so that it points to the right sq and that avoiding wrote MANY movesquare functions for each sq...

    Long post but I tried to explain my dilemma it the best way possible.

    Tried to use var: String and var: number but no luck...

    Thank you very much

    You can make use of notation of support use of target objects string values.  First think in terms of pass a number to such function as shown below...

    Button1.onPress = function() {movesquare("1")};

    Button2.onPress = function() {movesquare("2")};

    function movesquare (num) {}

    This ["sq" num] ._x plus sq._x + 1;

    }

  • How can I write a Dll to perform a union in visual studio for use in LabVIEW?

    Hello

    I am new to writing dll. I am trying to write a Dll that will perform a union on a number of LabVIEW and then return the result in LabVIEW for my use. I've been struggling with this during a few days and I finally give in to get help.

    This screenshot is the only description I have to help me with what I'm trying to do. Basically, I'm trying to pass a value that will be different according to a measurement of partial discharge. In the screen below, the value used is '1061111989' this number is my reading. I need to pass that value of labVIEW in my dll to perform a union on that.

    In my Dll, I need to write the value of MeterReading.IntVal and to the MeterReading.FloatVal.

    I have Visual Studio complete 2012 2012 Edition LabVIEW full, I'm LabVIEW CLAD and I wrote 17 floors of test to the United States to date. However, I've never needed Visual Studio so far. Can someone help me with this?

    Thanks in advance,-Chris

    Trying to create a Trade Union is stupid. Have you tried to make a simple conversion from type?

  • Can I do Expert Mode and full screen size my default setting for PES 11?

    Whenever I have open a new image in ACR and open image that the editing screen will return to the FAST mode and a smaller screen size.  I then have to click on to change to EXPERT mode, then click to make full screen.  I never had this problem with PES 10.

    (I get RAW images in from outside and not by the Organizer).

    Is there a way to define these default values?

    If you right click on the shortcut of PES 11 and select Properties, is whatever it is checked in the compatibility tab?

  • Random selection in SQL query

    I have a query or SQL, I write when I need to select the records in this way.
    More than these 2 folders and 2 files for each user name should be random.
    There are a lot of areas I get through my SQL; but the username there are usually around 20 unique user names.
    The data itself without random statement be added return about 2000 discs.

    If someone could help me with the syntax of the SQL portion that could achieve the results I'm looking for, I would appreciate it.
    I've never tapped into before random selection method.
    Someone told me I could use a rank() statement; but I have no idea how to use it.
    Then, someone else mentioned to use dbms_random.value which is another that I don't know how to use.

    Please let me know if you have any ideas that could help me.

    Thank you

    my request has just need a slight modification:

    SQL> select   deptno, ename
      from   (select   deptno, ename, row_number () over (partition by deptno order by dbms_random.value) rn
                from   emp)
     where   rn <= 2
    
        DEPTNO ENAME
    ---------- ----------
            10 CLARK
            10 KING
            20 JONES
            20 ADAMS
            30 MARTIN
            30 JAMES     
    
    6 rows selected.
    

    in my case deptno plays the role of your users!

  • We can create Script or action with item 11? If this isn't as I believe, item 12 will get this option or did in photoshop?

    I d like to use the Script function, one creating my own script or action.

    I think that this function is not possible in element 11 so the question would be is in the 12 element or just photoshop CC?

    Thank you

    Bertrand

    You can create your own scripts in a couple of different ways.

    (actions are easier to record than writing scripts, but we need full version of photoshop such as photoshop cs6 or cc2014 to record the actions)

    Java script is the most common, as it is works on mac and windows.

    (not to be confused with the manuscript of java for browsers, internet and such)

    You can write your own or it is possible that someone else has already written one.

    As far as stocks go, by far the easiest way is to use the full version of photoshop to record an action.

    (PES 11 can load and game record in photoshop actions, but was not built in the action recorder)

    It is probably much easier to find an already made to a script action.

    What kind of script or action did you have in mind?

  • Run script .jsx and/or the Actions button in HTML extension?

    Hi all

    I'm quite a novice at things .js, .jsx, and HTML.  I use scripts of JSX one former co-worker created and Photoshop actions for many years.  I looked through and have managed to modify the JSX scripts with a few minor changes, but that's all.  Using the Configurator, I created a custom for use in CS6 Panel.  We are moving finally CC2015 team and I'm the only person in our team who has experience and/or desire to convert compatible with CC 2015 Configurator easily created CS6 bench.  I got all of the HTML developed, interface extension runs within Photoshop and I have the buttons either launch an alert or by creating a new document in Photoshop.  The function of coding was all found code.  Now I need to figure out how to make these buttons work our various actions and some to run our scripts JSX.


    Configurator makes it is easy to select a button and tell it to perform an action or launch an external script file.  Is there an easy way to do this now using actions and JSX files that we have already created?

    And just a reminder, I'm a NEWB, so take it easy on me... if possible. In addition, it is only a sign used internally so I need power to market/sell it.  This is specific to our company of workflow and needs.

    Thank you!

    SMM

    for stocks, you can use this command

    ---

    Application.doAction (action: string, to: string)

    Object Adobe Photoshop CC 2015 library

    Playing the action specified in the Actions palette.

    Action: Data Type: string

    The name of the action to play. (Note that the action name is case-sensitive and must match the name in the Actions palette).

    of: Data Type: string

    The name of the action set that contains the action being played. (Note that the defined action name is case-sensitive and must match the name in the Actions palette).

    ---

    Make sure they are loaded in photoshop

    Another way is to convert action scripts (I see people often using this tool http://www.tonton-pixel.com/blog/scripts/utility-scripts/convert-actions-file/)

    and run the scripts, you put them on the .jsx file, where they will be evaluated, if you used standard mat and then call them by the name of the function

    I suggest you check out the samples, if you still have questions

  • Restore the options popup after selecting "Non-action" and choose to use this option, whenever a device is plugged in USB?

    Restore the options popup after selecting "Non-action" and choose to use this option, whenever a device is plugged in USB?

    Hello

    Did you follow the "AutoPlay Repair Wizard"?

    You can follow the link provided in the previous post. Later, check to see if the problem persists.

    Hope the helps of information.

  • "Random selection" for "Transitions" in Windows Movie Maker?

    For all that I can tell, Windows Movie Maker doesn't have a 'Random' selection for transitions.  It is this true or am I missing where the selection within the program?

    Hello ugotano,

    Welcome to the Microsoft Answers Forum!

    If you are looking for the option on how to change or add the transition in Movie Maker, here are the steps:

    1. on the table of the storyboard / timeline, click the second of the two video clips, titles or images that you want to add a transition between.
    2. click on tools, then on Transitions.
    3. in the content pane, click the transition that you want to add. You can click Play under the monitor to see a preview of what looks like the transition.
    4. click on the Clip and then click Add to timeline or add to the storyboard table.

    Here is an article you can do references who will give you information on the transitions:

    http://Windows.Microsoft.com/en-us/Windows-Vista/add-transitions-and-effects-to-pictures-and-video-in-Windows-Movie-Maker

    By default, Windows Movie Maker does not include transitions random, pans and zooms.  Adding Pan/zooms and transitions must be picture.
    You can apply the same transition to all the clamps at the same time:
    1. click on the 1st box of transition on the storyboard table (small box between the clips)
    2. do one of the following:
    3 Ctrl + A to select
    4 shift-click on the last transition box to select everything in between
    5 Ctrl-click the transitional areas to add them to the selection one by one.
    6. right click on the desired Transition and select "apply to the Storyboard object.

    I hope this information helps.

    Thank you
    H Irfan, Microsoft Answers Support Engineer.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Has anyone created a script opened on that charge action games?

    I still get tired, with Illustrator do not remember running a script in the scripts menu, after that Illustrator is closed. Whenever I open it I need to run a script, and then reload recorded actions so that I can use my scripts easier.

    If someone created a script that runs at startup of illustrator, runs a menu script, and then recorded actions loads? If not, anyone know if this is possible, as I will probably create.

    I had the following approach.

    You should always run a script, but now you have to do it once and also rely on some folders inside your folder My Documents.

    Re: Action: "Insert a Menu item" Script still not save CS6

    You can probably do an auto-hotkey or Applescript to show the file menu if, and I'm pretty lazy / do not use a lot of actions with scripts, where reloading only in this way is tolerable.

  • crop to selection in action while maintaining the cropped pixels

    Hello

    Is it possible to use the image > crop without deleting pixels outside that culture?

    I have a lot of images with a shadow I want to crop by using their path (selection)

    I do a deed which

    -selects the path (all named ' 1') of an image

    -image > crop the image to this selection

    In this way, the ratio is not contained in the action, BUT the pixels outside of the selection are removed. How do you define culture pixels cropped remember?

    Note: double click on the crop tool will give me the opportunity to uncheck 'delete pixels' but will contain the report of the harvest, making my action null.

    Thanks for your help

    Vanessa

    Ideally, I guess we should create a Script (in JavaScript).

    What structure in a layer?

    If there is only one layer to change it to a smart object, then using Image > Crop (with selection) might be an alternative.

  • Java Script: How to select all corner points?

    Java Script: How to select all corner points in the open document?

    This may be what you're after.

    Do not expect, this works on the complex paths.* *.

    very tight tolerance defined, this can be changed so smooth should not be too smooth.

    //------------------------------------------------------------------------------------
    //          Select "Sharp" or "Smooth" pathPoints
    //------------------------------------------------------------------------------------
    //
    //          Qwertyfly
    //          06/07/2015
    //          Version 1.0
    //
    //------------------------------------------------------------------------------------
    //
    //          *****Do Not expect this to work on complex paths.*****
    //
    //------------------------------------------------------------------------------------
    //
    //          Set tolerance here (this is in Radians)
    var tolerance = 0.0000000001;
    //
    //------------------------------------------------------------------------------------
    var doc = app.activeDocument;
    var myPoint, angle1, angle2, sel = "";
    var w = new Window('dialog');
    var B1 = w.add('button',undefined,"Select Corner Anchors");
    var B2 = w.add('button',undefined,"Select Smooth Anchors");
    var B3 = w.add('button',undefined,"Cancel");
    B1.onClick = function(){sel = "sharp"; goTime();}
    B2.onClick = function(){sel = "smooth"; goTime();}
    B3.onClick = function(){w.close()}
    w.show()
    function goTime(){
        w.close();
        doc.selection = null;
        for(var i = 0; i < doc.pathItems.length; i++){
            for(var j = 0; j < doc.pathItems[i].pathPoints.length; j++){
                myPoint = doc.pathItems[i].pathPoints[j];
                if(sel == "smooth"){
                    if(isSmooth()){
                        myPoint.selected = PathPointSelection.ANCHORPOINT;
                    }
                }else if(sel == "sharp"){
                    if(!isSmooth()){
                        myPoint.selected = PathPointSelection.ANCHORPOINT;
                    }
                }else{alert("error");}
            }
        }
    }
    function isSmooth(){
        angle1 = Math.atan2(myPoint.leftDirection[1] - myPoint.anchor[1],myPoint.leftDirection[0] - myPoint.anchor[0]);
        angle2 = Math.atan2(myPoint.rightDirection[1] - myPoint.anchor[1],myPoint.rightDirection[0] - myPoint.anchor[0]);
        return(Math.abs((angle1 - angle2)) > Math.PI - tolerance && Math.abs((angle1 - angle2)) < Math.PI + tolerance);
    }
    

Maybe you are looking for

  • Polyfit forced through the origin?

    Is there an easy way to force a 3rd order through the origin polyfit or slow down through a point?

  • Cannot save a games for Windows 7 on Xbox.

    Why can't I buy a dazzle 100 for windows 7 to save my games on xbox, but I can for windows vista/xp/and all the others but not windows 7...

  • Publish as root Explorer

    I have tried to get explore published as root with / root under the Applications managed by vWorkspace 7.6 but can't seem to find the correct settings. Path: c:\Windows\Explorer.exe Arguments: C:\Tools (I created this folder on the root to test with)

  • Local AIR-CAP702W ethernet ports

    Hi all The new AIR-CAP702W AP have local Ethernet ports 10/100/1000Base-T 4.On the card, it is written "for wired devices connectivity. http://www.Cisco.com/c/en/us/products/collateral/wireless/Aironet-700-se... That's fine, but how manage the traffi

  • ASA 5510 Configuration. How to set up 2 outside the interface.

    Hello I have Cisco ASA 5510 and the desktop, I want to create a new route to another (external) router to my ISP. The workstation I can Ping ASA E0/2 interface but I cannot ping the router ISP B inside and outside of the interface. I based my setup o