Re: Moving Files in a Folder to Another Folder
Re: Moving Files in a Folder to Another Folder
- Subject: Re: Moving Files in a Folder to Another Folder
- From: "koenig.yvan" <email@hidden>
- Date: Sun, 20 Jan 2013 14:48:40 +0100
It continues to amaze me just how efficiently Applescript can make simple things a PITA.
Put these lines in a text file and store it anywhere.
cd . . . full path to the folder actions directory you want to use. mv *.htm /Volumes/drive1/folderstuff.f1/ mv *.txt /Volumes/drive1/folderstuff.f2/ mv *.jpg /Volumes/drive1/folderstuff.f3/
Then write a one line Applescript and "do shell script" to execute the stored file whenever you poke a button.
Request the details you need about the mv command with a "man mv" command in terminal.app. The * in the filenames is a globbing character that represents any string of characters. It also will use just filenames that END with the suffixes rather than find them anywhere in the filename. You could add a * like this:
mv *.htm* /Volumes/drive1/folderstuff.f1/
to get the exact results that your Applescript would perform and do the right thing for somefile.html and somefile.jpeg.
You could also add the full path to the targeted directory before the first asterisk of each line.
--
If I understand well (I never used cd before), we may use :
on adding folder items to this_folder after receiving added_items do shell script "cd " & quoted form of POSIX path of this_folder & linefeed & "mv *.htm '/Volumes/drive1/folderstuff.f1/'" & linefeed & "mv *.txt '/Volumes/drive1/folderstuff.f2/'" & linefeed & "mv *.jpg '/Volumes/drive1/folderstuff.f3/'" end adding folder items to
Yvan KOENIG (VALLAURIS, France) dimanche 20 janvier 2013 13:49:23
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden