Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 31, 2013, 12:42 AM   #1
dglenn9000
macrumors newbie
 
Join Date: Sep 2007
Applescript to move all .mp4 & .m4v from dropbox

I am looking for an Applescript to move all .mp4 & .m4v from my dropbox folder to my itunes media folder. Any suggestions?
dglenn9000 is offline   0 Reply With Quote
Old May 31, 2013, 01:59 PM   #2
kryten2
macrumors 6502a
 
Join Date: Mar 2012
Location: Belgium
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 ...
__________________
Space Corps Directive 34124

Last edited by kryten2; Jun 2, 2013 at 09:18 AM.
kryten2 is offline   0 Reply With Quote
Old Jun 1, 2013, 05:24 PM   #3
sero
macrumors member
 
Join Date: Aug 2008
one liner in terminal

Code:
for i in $(find ~/Dropbox -name "*.mp4"); do mv $i itunes_folder; done
sero is offline   0 Reply With Quote
Old Jun 1, 2013, 05:44 PM   #4
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by sero View Post
one liner in terminal

Code:
for i in $(find ~/Dropbox -name "*.mp4"); 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).
chown33 is offline   0 Reply With Quote
Old Jun 1, 2013, 06:41 PM   #5
subsonix
macrumors 68040
 
Join Date: Feb 2008
Quote:
Originally Posted by sero View Post
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.
subsonix is offline   0 Reply With Quote
Old Jun 3, 2013, 01:35 AM   #6
sero
macrumors member
 
Join Date: Aug 2008
Quote:
Originally Posted by chown33 View Post
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.
sero is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Convert iTunes .m4v to .mp4 bigpoppamac31 Digital Video 21 Dec 2, 2014 11:52 PM
Optimizing mp4/m4v files MoodyM Apple TV and Home Theater 10 Jan 20, 2014 10:06 AM
Tutorial & benchmarks: optimizing your MP4 (MOV / M4V) video files Menneisyys2 Apple TV and Home Theater 7 Feb 2, 2013 10:50 AM
mp4 vs m4v heisenberg123 Apple TV and Home Theater 7 Sep 24, 2012 07:16 PM
M4V to MP4 ma5ter5 Digital Video 9 Jul 30, 2012 10:18 AM

Forum Jump

All times are GMT -5. The time now is 03:23 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC