Another Automator thread... Bwana please help.

StonerStuart

Expert Member
Joined
Nov 23, 2010
Messages
3,487
Reaction score
24
Location
The land of Sobriety
Hi everybody...

i have thousands of movies in folders and some or the majority are empty.

i want to run a workflow to move files from sub-folders to one main movie folder.

is there anyone who knows how to do it?

please help

§
 
Hi everybody...

i have thousands of movies in folders and some or the majority are empty.

i want to run a workflow to move files from sub-folders to one main movie folder.

is there anyone who knows how to do it?

please help

§
There's an App called Suction that can move all the files into the parent folder.. Before running it I suggest you make sure all files are named/renamed before doing this.

http://www.freewaregenius.com/sucti...irectory-structure-into-the-parent-directory/
 
Sorry, not going to be of much help since I wouldn't use automator to do this task.

What I would do is search within that parent folder for the movies (either by type or by file extension) and then just select them all and move them to the parent folder.

Hope someone can help you though.
 
You don't need automator, just some bash. Let's assume the following

1. /Users/yourname/Movies - has all your movies in a million subfolders
2. /Users/yourname/new_movies - where you want to put them all.
3. All the files under Movies/ are in fact, movies - no other file types present.
4. You don't have duplicate file names. The below will simply leave them out.

Open a terminal, go to Preferences --> Setings --> Window and set the Scrollback to unlimited.

Code:
find Movies -type f -exec mv -nv {} new_movies/ \;

The output on screen will tell you which ones have been moved and which ones havent. -n tells it to skip duplicate names, -v tells it to be verbose.
 
If you are doing things like this often enough - I can seriously recommend a piece of software called Hazel (made by Noodlesoft)... They have a trial version available... It requires a fair bit of initial input (for someone with zero coding background, like me) - but the results are quite mind-blowing...

The first time I managed to get an annotated pdf off my NoteTaker HD app on my ipad, via email through IFTTT.com & Dropbox, onto my Mac - which then checked to see if it was OCR'ed, and when it was found not to be - had it sent to PDFPen to be OCR'ed, then renamed, labelled and tagged/keyworded, before being put into a specific sub-folder that was first created and then named according to a series of criteria/rules that I had set-up - all without any input from me - I realised I might be on to something... :)
 
You don't need automator, just some bash. Let's assume the following

1. /Users/yourname/Movies - has all your movies in a million subfolders
2. /Users/yourname/new_movies - where you want to put them all.
3. All the files under Movies/ are in fact, movies - no other file types present.
4. You don't have duplicate file names. The below will simply leave them out.

Open a terminal, go to Preferences --> Setings --> Window and set the Scrollback to unlimited.

Code:
find Movies -type f -exec mv -nv {} new_movies/ \;

The output on screen will tell you which ones have been moved and which ones havent. -n tells it to skip duplicate names, -v tells it to be verbose.



holy hell, you know your stuff. that is way above my understanding of mac...
ive only used mac for a few years.

i think if i try that i will destroy it or blow up the mac!

§
 
If you are doing things like this often enough - I can seriously recommend a piece of software called Hazel (made by Noodlesoft)... They have a trial version available... It requires a fair bit of initial input (for someone with zero coding background, like me) - but the results are quite mind-blowing...

The first time I managed to get an annotated pdf off my NoteTaker HD app on my ipad, via email through IFTTT.com & Dropbox, onto my Mac - which then checked to see if it was OCR'ed, and when it was found not to be - had it sent to PDFPen to be OCR'ed, then renamed, labelled and tagged/keyworded, before being put into a specific sub-folder that was first created and then named according to a series of criteria/rules that I had set-up - all without any input from me - I realised I might be on to something... :)

i scratched my head throughout that whole post.. i am a serious laymen in comparison!
 
Ok this is way above my head...

I think ill do it the drag and drop way :)

you guys are like these pros and i only just recently learnt from bwana that you can open "get info" for more than one item in one dialog!
 
What is cli if i may ask?

Command Line Interface.

Click on the spotlight icon in the top right (the little hour glass) on the menu bar, and type "terminal" - Open terminal. That's the CLI.

Now, in the terminal, type:

Code:
ls -lh

There are nine columns. Don't worry too much about the stuff in the first four columns on the left. The rest looks straight forward, right?

Now, try:

Code:
du -sch *

How about that? Can't do that with Finder...

Going back to the code I posted earlier, if you just want to see which files it will find, do:

Code:
find Movies -type f

This will show you every file in the Movies directory.
 
Command Line Interface.

Click on the spotlight icon in the top right (the little hour glass) on the menu bar, and type "terminal" - Open terminal. That's the CLI.

Now, in the terminal, type:

Code:
ls -lh

There are nine columns. Don't worry too much about the stuff in the first four columns on the left. The rest looks straight forward, right?

Now, try:

Code:
du -sch *

How about that? Can't do that with Finder...

Going back to the code I posted earlier, if you just want to see which files it will find, do:

Code:
find Movies -type f

This will show you every file in the Movies directory.

Sheeet thats amazing...

ok now what if the directory is on an external drive and not in movies?
 
Sheeet thats amazing...

ok now what if the directory is on an external drive and not in movies?

All external drives are represented on the filesystem as:

/Volumes/DRIVE_NAME

where DRIVE_NAME is what you see on the side in Finder. So do:

Code:
ls -lh /Volumes
 
ok, so i need to create an empty folder to send all the movies to first on that drive.
then i run that script that you gave me, will that now remove all movies from their folders and only move the ones that are not duplicate names?


Is this right?

ls -lh /Seagate Backup Plus Drive find Movies -type f -exec mv -nv {} new_movies/ \;


or


ls -lh /Volumes/Seagate Backup Plus Drive find Movies -type f -exec mv -nv {} new_movies/ \;
 
ok, so i need to create an empty folder to send all the movies to first on that drive.
then i run that script that you gave me, will that now remove all movies from their folders and only move the ones that are not duplicate names?


Is this right?

ls -lh /Seagate Backup Plus Drive find Movies -type f -exec mv -nv {} new_movies/ \;

No, not in one line. For one, you can't put spaces in a file name. Also, you didn't mention the files are on an external drive.

What do you see when you do "ls -lh /Volumes" ? You should see the Seagate one under that. If so, you can do the following:

Code:
ls -lh /Volumes/Seagate\ Backup\ Plus\ Drive

If it doesn't work up to this point, then maybe this isn't the right method for you.
 
this is exactly what i see:




Last login: Fri Aug 9 19:13:48 on ttys000
Stuarts-Mac-mini-4:~ Stuart$ ls -lh /Volumes
total 328
drwxrwxrwx@ 1 Stuart staff 128K Jan 1 1980 1024
lrwxr-xr-x 1 root admin 1B Aug 9 09:09 Macintosh HD -> /
drwxrwxrwx@ 19 Stuart staff 714B Aug 2 19:05 My HDD 3TB
drwxrwxrwx@ 1 Stuart staff 32K Aug 5 15:32 NIKON D90
drwxrwxr-x@ 959 Stuart staff 32K Aug 9 15:58 Seagate Backup Plus Drive
drwx------ 1 Stuart staff 264B Jul 29 02:01 The Base Station
Stuarts-Mac-mini-4:~ Stuart$
 
thank you koffiejunkie for showing me this terminal thing.

its pretty cool, ill try some things on it to get a grasp on it, but i dont want to stretch your helpful hand.

thanks for your help.

§
 
Top
Sign up to the MyBroadband newsletter
X