Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

feuerschlange

macrumors regular
Original poster
Oct 13, 2008
221
0
I want to host photographs on a website, where I need a Automator action, that generates random filenames (i.e. filename of 8 random numbers).

I want to create a Automator script for exporting photographs from Lightroom and uploading them within their automatically created random named folders.

Any ideas, how to generate random folder names?
 

Thanks for posting - too bad, it doesn't help for the issue.
I need something, that can be used in an Automator.app workflow (a tip with using automators "random variable function" for renaming a folder for example). An seperate app, that creates a random number and renames a file with it would be most useful too, as I could use this within automator too.
 
There's a shell command I know that generates random strings:

openssl rand -base64 8

Change 8 at the end to whatever you want the length of the random string to be. I know theres a "Run Shell Script" automator action so you can use this and then pipe the output to whatever action you are using to name the folders
 
There's a shell command I know that generates random strings:

openssl rand -base64 8

Change 8 at the end to whatever you want the length of the random string to be. I know theres a "Run Shell Script" automator action so you can use this and then pipe the output to whatever action you are using to name the folders

Mmmh - I tried it and have two issues:

-the shell command gives random signs (what should I change, to output only numbers?)

-it seems, that the output of the "Run Shell Script" command in automator creates a variable, that can not be used, to rename a file.

Looks like a dead end so far.

There is a Automator variable called "random number", which creates a variable and can also not be used.
 
Mmmh - I tried it and have two issues:

-the shell command gives random signs (what should I change, to output only numbers?)

-it seems, that the output of the "Run Shell Script" command in automator creates a variable, that can not be used, to rename a file.

Looks like a dead end so far.

There is a Automator variable called "random number", which creates a variable and can also not be used.

Check the Automator Programming Guide to see if there's something that can be done with the shell.


If so, try either of these two:

Code:
openssl rand -hex 4
Code:
mktemp -d /path/to/www/XXXXXXXX

The second one will create a folder under /path/to/www with 8 random characters and will do so safely (i.e. it will not create a directory with the same name). After creating it, it will output the name of the newly created directory as well. I recommend the latter.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.