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

amiskwia

macrumors newbie
Original poster
Nov 1, 2007
24
0
Seville - Spain
Hello everybody!!! Here is my situation:
I have a digital photo frame to see my pictures, but it only plays photos secuencially, it can't be set on "shuffle". So if I could rename the photos with random names, then the effect would be the same, as I would be seeing them in "shuffle".
I know automator can rename files, and there are many many apps that also rename, but I haven't found one that can give the files a random name!
Any suggestions??
Thank you.
 
I needed to do the same thing for the same exact reason. I made this shell script that did it but it must have messed up resource forks or something because it broke all my jpg files! (I had copies)

Anyway, if you have access to Windows this is a really easy way to do it:
http://www.winsite.com/bin/Info?2000000035423

It's called renamer.exe and it can add a random number to file names in a batch.
 
Image Well does this - it has a little icon in the top left corner for creating random file names. But I don't think it does batch.

You can find it here

NameMangler does do batch renaming and I think there is probably an advanced option where you could randomise the names (although I have never tried to do it), the link can be found on the site in my sig.
 
I needed to do the same thing for the same exact reason. I made this shell script that did it but it must have messed up resource forks or something because it broke all my jpg files! (I had copies)

Anyway, if you have access to Windows this is a really easy way to do it:
http://www.winsite.com/bin/Info?2000000035423

It's called renamer.exe and it can add a random number to file names in a batch.

Hi! I am currently using renamer.exe through VMWare, until I can find a mac app that does the same. Thanks!

Image Well does this - it has a little icon in the top left corner for creating random file names. But I don't think it does batch.

You can find it here

NameMangler does do batch renaming and I think there is probably an advanced option where you could randomise the names (although I have never tried to do it), the link can be found on the site in my sig.

I tried NameMangler, but could not find any random name option :(
 
If you click at the top and change to advanced, you have an option to do some coding there, so I am sure you could look at the example scripts given, but that is too technical for me, sorry and maybe also look for a NameMagler forum or contact the author, I am sure it is possible as it is a great app.
I tried NameMangler, but could not find any random name option :(
 
If you're ok with pasting something into the command line do this

Code:
for i in *.jpg; do mv $i $RANDOM.jpg; done

just open the terminal, drag your folder in to the terminal window to change the active directory in the terminal, and paste that in press enter.
 
Try renamer4mac that may do the job

Thanks for the tip, but I'm looking for a free solution.

If you're ok with pasting something into the command line do this

Code:
for i in *.jpg; do mv $i $RANDOM.jpg; done

just open the terminal, drag your folder in to the terminal window to change the active directory in the terminal, and paste that in press enter.

I open a terminal window, drag the folder inside, paste that code and press enter. I get the error:

-bash: syntax error near unexpected token `do'

I have no clue how to use terminal commands, so I don't know what's wrong.
Thanks for the help.
 
If you're ok with pasting something into the command line do this

Code:
for i in *.jpg; do mv $i $RANDOM.jpg; done

just open the terminal, drag your folder in to the terminal window to change the active directory in the terminal, and paste that in press enter.

In Terminal first type
Code:
cd
(space after 'cd')
THEN drag your directory to the Terminal window and press return. That will change to your image directory. Then paste
Code:
for i in *.jpg; do mv $i $RANDOM.jpg; done
just like Wil said.
I just tried it and it works as you'd expect.
 
Now it worked. With the cd space thing and I had to type JPG in capital leters for it to work, because all my pics extension are .JPG and not .jpg

Now I'll investigate a bit and see if I can put this into an automator workflow or an applescript or something.

Thank you very much for all the help.
 
Thanks for dropping the ball I left there Darth.Titan, and I'm glad you got it to work amiskwia :D
 
So, this is a handy one line script, but what happens if the RANDOM number generated is the same as one previously generated. Will the previous file be overwritten, or will the old file retain its current name?
 
Waking this thread up as I have the same requirement and hoping someone good at scripts cam answer this;.

The above script works only for a single directory level (I just tried it) and though there is the issue of what happens if the random name is the same presumably that can be managed with an 'if not exists' or whatever the equivalent is for Mac, but I have an additional requirement that I am hoping a script 'whiz' can come up with an easy answer for.

If the original files are in a more complex directory structure than a single level , the script doesnt work, it doesn't rename files in "sub folders". What I need is to copy all the files into a 'flat' directory structure and rename.
Example, starting with;

Top Folder
>Folder A
>>File01
>>File02
>>>Folder B
>>>>File03
>> Folder C
>>> File 5
> Folder D
etc

I'd like to get to
Top Folder
random file name 1
random file name 2
random file name 3
etc

It doesn't matter if the original folders are left around empty.

Anyone care to have a go at a script?

I have a similar conversation over here so best to reply there should anyone be so inclined as to reply. Thanks.
 
Where does this output to?

Sorry to re-ignite a thread from some time ago, but trying to use the code suggested and unsure whether the code is executing, or if so, where it is placing the output.

I have navigated through to the folder in which the files to rename are located. I am then using:

for i in *.jpg; do mv $i $RANDOM.jpg; done

as suggested by Wil. This leads to a repeated screen display of:

usage: mv [-f | -i | -n] [-v] source target
mv [-f | -i | -n] [-v] source ... directory

I have not been able to identify any output from the process in the directory.

If I change the file extension I get a message to say file not found, so the issue does not appear to be identification of files.

Sure this is a simple fix, but no idea where to start. Can anyone help?

Thanks
 
this should seriously be built into OS X, ridiculous

It is and it's called Terminal. Learn those commands and you can do practically anything you wish.

I don't know of _any_ OS that has a program that automatically does this.
 
This site offers some services and automations. the have a rename selected files service that will do what you want i think.

the attachment shows how it will look when installed. you just select the items you want renamed, right click, and go down to Services and than over to Disk item - Rename selected items and there will be some options to rename the files.

http://www.macosxautomation.com/services/download/index.html
 

Attachments

  • Screen shot 2009-09-30 at September 30, 9.44.07 AM.png
    Screen shot 2009-09-30 at September 30, 9.44.07 AM.png
    65.7 KB · Views: 960
So, this is a handy one line script, but what happens if the RANDOM number generated is the same as one previously generated. Will the previous file be overwritten, or will the old file retain its current name?

It unfortunately does overwrite files because I am having this problem. :-/
Does anyone know of an Applescript to check to make sure it doesn't overwrite?
 
Code:
for i in *.jpg; do mv $i `od -An -N2 -i /dev/random`.jpg; done

note that those are grave accents, not apostrophes.
 
I think the price of that application is VERY reasonable. In the way past, everything was hundreds of dollars. I think $25 is very affordable. These days we are so spoiled by the low prices that we don't appreciate when something is so inexpensive. We need to support those people who work hard at making them. They are not trying to rip us off. They are just trying to make a living.
 
I think the price of that application is VERY reasonable. In the way past, everything was hundreds of dollars. I think $25 is very affordable. These days we are so spoiled by the low prices that we don't appreciate when something is so inexpensive. We need to support those people who work hard at making them. They are not trying to rip us off. They are just trying to make a living.
I don't think it's so much the price itself, but the fact that there are free apps can do the same thing.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.