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

Levi Alberta

macrumors newbie
Original poster
Jan 29, 2014
5
0
I'm attempting to use Automator on my Macbook Pro and Mac Mini (Mavericks) unsuccessfully.

I have numerous files (videos) in one folder and I'm attempting to move specific files from one folder to another. I have been attempting to create folder actions so when a file is placed in the folder, it gets sorted immediately.

The first folder action is attached.

It was unsuccessful because it wouldn't find the items properly. For example, I had it searching for Family.Guy or Family Guy and it would move the appropriate files to a folder named "Family Guy". It would let through other items such as Arrow when clearly it is not even close to being the same. I found that it would work if I only had one folder action assigned. As soon as I had more then 1 I would begin experiencing the same problems.

I then moved onto my next test which involved filtering. It is attached as well.
This version was successful as long as I didn't have more then one. I made 4 folder actions with different sorting features (Trophy.Wife, Hawaii.Five, Justified, Family.Guy) however only the first one would actually work. After the first folder action completed (in this case it was Family.Guy) it would not move onto the next folder action. I tried combining all of the folder actions into one using the same methods as shown in the picture but it still wouldn't move onto the next item.

What am I doing wrong? I figured this would be very simple but for some reason I can't get it to work.

You may notice that sometimes I'm searching for Family.Guy or Family Guy. That is because the file name is not always the same. Some have periods, some do not.
 

Attachments

  • Screen Shot 2014-01-29 at 3.27.12 PM.png
    Screen Shot 2014-01-29 at 3.27.12 PM.png
    50.8 KB · Views: 286
  • Screen Shot 2014-01-29 at 3.30.54 PM.png
    Screen Shot 2014-01-29 at 3.30.54 PM.png
    55.9 KB · Views: 213

kryten2

macrumors 65816
Mar 17, 2012
1,114
99
Belgium
I'm attempting to use Automator on my Macbook Pro and Mac Mini (Mavericks) unsuccessfully.
Here's a Folder Action Script you can use. Don't forget to make the necessary changes. Open Applescript Editor and copy and paste the code into the window then save it. Copy the script to the Library==>Scripts==>Folder Action Scripts folder. In Finder right click the folder you want the script to attach to and from Services choose Folder Actions Setup. Select your script and click attach.

Code:
on adding folder items to this_folder after receiving these_items
	(*
	Variables for the various destinations. You need to change them to where you want to move your files! ¬
	In my case the result of the first line is "MavericksDP:Users:kryten:Documents:FolderActionResult:Family Guy" ¬
	eg "nameofyourhd:Users:yourusername:folder:folder:folder"
*)

	set fgDest to (path to documents folder as text) & "FolderActionResult:Family Guy"
	set hwDest to (path to documents folder as text) & "FolderActionResult:Hawaii Five"
	set jDest to (path to documents folder as text) & "FolderActionResult:Justified"
	set twDest to (path to documents folder as text) & "FolderActionResult:Trophy Wife"
	
	repeat with anItem in these_items
		tell application "Finder"
			if name of anItem contains "Family Guy" or name of anItem contains "Family.Guy" then
				move anItem to fgDest
			else if name of anItem contains "Hawaii Five" or name of anItem contains "Hawaii.Five" then
				move anItem to hwDest
			else if name of anItem contains "Justified" then
				move anItem to jDest
			else if name of anItem contains "Trophy Wife" or name of anItem contains "Trophy.Wife" then
				move anItem to twDest
			end if
		end tell
	end repeat
end adding folder items to
 

Attachments

  • Screen Shot 2014-01-30 at 04.14.17.png
    Screen Shot 2014-01-30 at 04.14.17.png
    88.5 KB · Views: 178
  • Screen Shot 2014-01-30 at 04.14.29.png
    Screen Shot 2014-01-30 at 04.14.29.png
    48.2 KB · Views: 185
  • Screen Shot 2014-01-30 at 04.18.55.png
    Screen Shot 2014-01-30 at 04.18.55.png
    10.2 KB · Views: 170

Levi Alberta

macrumors newbie
Original poster
Jan 29, 2014
5
0
Thank you for your response. Looks like it should work perfectly.

Shortly after pulling out what little hair I had remaining (and making that post), I downloaded a trial version of Hazel. I tried the same thing with Hazel and it worked perfectly.

Either way, free is better then spending money so I will be sure to give that script a shot.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.