Apple script: move all the .avi files

Joined
Aug 25, 2009
Messages
7
Reaction score
0
Points
1
Hi to all,
I wrote the following script to be used as a folder action. What I want is that, whenever a new .avi or .mov file is added to the folder where i attach it, that file is move to my movies folder.

It is not working thought. Any help?

The code:

Code:
property extension_list : {"avi", "mov"}

on adding folder items to this_folder after receiving these_items
	repeat with i from 1 to number of items in these_items
		set this_item to item i of these_items
		tell application "Finder"
			if (the name extension of this_item is in the extension_list) then
				tell application "Finder"
					move this_item to "/Users/gu/Movies"
				end tell
			end if
		end tell
	end repeat
end adding folder items to
 
Joined
Nov 16, 2009
Messages
1
Reaction score
0
Points
1
The problem appears to be the way you stated the path to the destination folder. Instead of "/Users/gu/Movies", I think you need to state the absolute path and use colons as separators instead of forward slashes. I tried your script on my Mac and changed nothing except that and it worked like a charm. That is, I changed the path to: "Lacie:Users:Steve:Movies"
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top