|Feb 19, 2013, 03:38 AM||#1|
Use applescript automatic copy Specified files from new added Mobile hard disk to mac
I use a 2012mac mini as a home server,after read some applescript introduce,I found a vast space about automatic processing on Mac OS.
Now I am thinking use a applescript copy the specified files from new added Mobile hard disk to Mac mini when the new disck just connected to mac mini.
a USB hard drive have movie/music/pic/ folders,when it connected to mac mini,the script can automatic copy those folders' files to mac itself at different folders.
If script can do more,I wonder it can identify different extend of files,that can make mkv/avi/rmvb as movie files copy to mac's movie folder,mp3/m4a as music files copy to music folder,so as pic.
Expression may not be detailed,looking forward to your answers！
Last edited by woshiysc; Feb 19, 2013 at 07:51 AM. Reason: applescript folder
|Feb 19, 2013, 09:43 AM||#2|
There's a couple of ways to do what you want. Applescript or a combination of Applescript and a LaunchAgent or another application or a System preference pane. You might want to take a look at DSW. Do Something When is a system preference pane that allows the user to watch for drives mounting and un-mounting, allowing them to launch or quit applications, when these events happen. This in combination with an Automator app or Applescript app should do the trick. You could do something like this with Automator actions :
Info : http://www.azarhi.com/Projects/DSW/index.php
Space Corps Directive 34124
Last edited by kryten2; Feb 20, 2013 at 02:33 PM.
|Feb 20, 2013, 02:28 AM||#3|
It's really very helpful!
But I still have two questions:
1.How can the script avoid copying same files when mounting USB drive times.
2.If I mount different drives with different names,can the Automator identify them and copy the files,I search the DSW and it may achieve this function，but I tend to use applescript or Automator release the function.
Looking forward to your wonderful answer！
|Feb 20, 2013, 09:47 AM||#4|
1) I may be wrong on this but if you check Replace existing files in the Copy Finder Items the file will be replaced. If you leave it unchecked and the file exists it will not be copied.
2) Make a rule in DSW for every external disk and for every rule make a workflow with changes made to the where part in the Find Finder Items pointing to the correct external disk.
You're not the first person to ask to do something when a drive mounts. It can be done with Applescript but it will take some time and work from you to put it all together. You can also attach a folder action to the /Volumes folder. I've included some more info to get you started.
Info : http://stackoverflow.com/questions/1...rt-a-usb-drive
Space Corps Directive 34124
|Feb 20, 2013, 12:19 PM||#5|
I had aready thought about folder action,but don't know which folder to watch and the next steps!
Those information are exactly in line with my idea!
Thank you very much again,and I have to learn those data and release the idea on my Mac mini~
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|How to carbon copy an old hard disk with mountain lion on MBP-retina's SSD||player1024||MacBook Pro||3||Oct 18, 2014 11:46 AM|
|Can't copy files from my external hard drive||Simont83||OS X||4||Aug 21, 2014 02:14 PM|
|Copy files to folder using Applescript||Kitkat88||Mac Programming||7||Jun 23, 2014 08:45 AM|
|Can a mac do a bitwise copy of a USB disk with proprietary disk format?||deacLL||OS X Mavericks (10.9)||10||Apr 10, 2014 08:14 AM|
|Need applescript help - Copy files from desktop to NAS||Polansky||Mac Programming||1||Dec 24, 2012 02:08 PM|
All times are GMT -5. The time now is 04:04 PM.