RetouchPRO

Go Back   RetouchPRO > Tools > Software > Photoshop Scripting
Register Blogs FAQ Site Nav Search Today's Posts Mark Forums Read


Photoshop Scripting Learning and sharing for all platforms

can a script pick a random action?

Reply
 
Thread Tools
  #1  
Old 03-24-2005, 02:23 PM
okplayer okplayer is offline
Member
 
Join Date: Jul 2003
Posts: 44
can a script pick a random action?

Given a specific set of actions, is there any way to make a script randomly pick one of the actions and apply it to an image?
Reply With Quote top
  #2  
Old 03-24-2005, 03:43 PM
DannyRaphael's Avatar
DannyRaphael DannyRaphael is offline
Moderator
 
Join Date: Mar 2002
Location: Near Seattle, Washington, USA
Posts: 6,300
Quote:
Originally Posted by okplayer
Given a specific set of actions, is there any way to make a script randomly pick one of the actions and apply it to an image?
One way to do this would be as follows...

Suppose you had 10 candidate actions...
* The script would include commands to execute each of them, say, via a table of action names or individual "DoAction" commands
* Generate a random number 0-9 within the script
* Execute the corresponding action

Don't ask me how to "code this" , but functionally this would work. Ro and Rex are the resident coding experts.

HTH...

~Danny~
Reply With Quote top
  #3  
Old 03-31-2005, 02:34 PM
xbytor xbytor is offline
Member
 
Join Date: Aug 2004
Posts: 35
Random Acts of PS

Try something like:

var actions = [
"act1",
"act2",
"act3",
"act4",
/...
"actN",
];

var randomAction = actions[Math.floor(Math.random() * actions.length)];
Reply With Quote top
  #4  
Old 03-31-2005, 03:23 PM
byRo's Avatar
byRo byRo is offline
Senior Member
 
Join Date: May 2004
Location: Goianésia, Brazil
Posts: 1,609
Quote:
Originally Posted by DannyRaphael
Ro and Rex are the resident coding experts.
I think you can include xbytor in your list - seems like he's got it nailed

Reply With Quote top
  #5  
Old 03-31-2005, 04:12 PM
xbytor xbytor is offline
Member
 
Join Date: Aug 2004
Posts: 35
Quote:
Originally Posted by byRo
I think you can include xbytor in your list - seems like he's got it nailed
Thanks. While this may be true, I am an infrequent visitor as opposed to 'resident'.
Reply With Quote top
Reply

  RetouchPRO > Tools > Software > Photoshop Scripting


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Actions skydog Software 9 03-29-2007 03:42 PM
Action or script to save 2 output files bouloss Photoshop Scripting 1 05-13-2006 10:51 PM
rules of third script or action? Lasse Photoshop Scripting 2 08-17-2005 09:38 PM
A gratitude post for a great action script RalphBenmurgia Photo-Based Art 3 02-20-2005 03:43 PM
Script or action for 50% guides Doug Nelson Photoshop Scripting 11 01-04-2005 11:56 PM


All times are GMT -6. The time now is 01:02 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
Copyright © 2016 Doug Nelson. All Rights Reserved