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

dglenn9000

macrumors member
Original poster
Sep 23, 2007
41
1
I am looking for an Applescript to move all .mp4 & .m4v from my dropbox folder to my itunes media folder. Any suggestions?
 
I would suggest you take a look at Automator to do this.

Edit : If dropbox folder is on indexed drive then mdfind is fast. But like subsonix said if you want iTunes to be aware of them you need to import them.

Code:
mdfind -0 -onlyin ~/Dropbox/ "(kMDItemFSName = "*.mp4" || kMDItemFSName = "*.m4v")" | xargs -0 ...
 
Last edited:
one liner in terminal

Code:
for i in $(find ~/Dropbox -name "*.mp4"); do mv $i itunes_folder; done
 
one liner in terminal

Code:
[COLOR="Red"]for i in $(find ~/Dropbox -name "*.mp4")[/COLOR]; do mv $i itunes_folder; done

The red-hilited part can be replaced with:
Code:
for i in ~/Dropbox/*.mp4
Shell pattern-matching (globbing) suffices.

FWIW, the posted code won't work if there are spaces embedded in any filename. The problem exists for both approachs ('find' or globbing).
 
one liner in terminal

Code:
for i in $(find ~/Dropbox -name "*.mp4"); do mv $i itunes_folder; done

I don't think it's enough to just move the files, if you want iTunes to be aware of them you need to import them. There is an "import to iTunes" action available in Automator though, and it's also available by default in the context menu on OS X if you select a media file.
 
The red-hilited part can be replaced with:
Code:
for i in ~/Dropbox/*.mp4

I was assuming the files are not all in the top level dir, otherwise this would be easy enough in finder. But the OP didn't really specify.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.