Skip to main content
Known Participant
April 12, 2019
Question

Random Selection of Actions with Script. Possible?

  • April 12, 2019
  • 2 replies
  • 739 views

Hello, can a script randomly select from lets say a set of 100 actions, two of them and excecute them?
I have a make an Actions collection of album designs and I would like to add a feature of random selection (kind of the button "I'm feeling lucky").

Can that be possible?

This topic has been closed for replies.

2 replies

Chuck Uebele
Community Expert
Community Expert
April 13, 2019

You could possible modify this script by Paul that gets the names of the actions in a set, then add a random selection to that list:

Return a list of actions for the user to choose from. - PS-SCRIPTS.COM

JJMack
Community Expert
Community Expert
April 13, 2019

If you have a set of actions you need to somehow get the set name you your script, Have a script dialog, hard code the set name or prompt for the set name. Once the script knows the set name it can retrieve the actions name in the set into an array then generate two random numbers  within the length of the array of names. If there are open documents the script can play the action on the open documents.

Normally I would expect action that create albums would need to some how get sets of image files to populate  an album design.  A script can play actions that work without any open docyments.  So a script can play that type of action also

JJMack