Hey all,
I've been trying to do an automator/applescript program that will attach as a plugin to my downloaded torrents folder and am having some troubles.
What I want to do is once a movie torrent is downloaded and is transferred to my Movies folder on my external drive I want this applescript script to act on it:
on open ml_movie
set my_location to (path to desktop) as text
tell application "QuickTime Player"
launch
close every document
open ml_movie
set movie_name to name of document 1
set save_location to my_location & movie_name & ".mov"
save document 1 in save_location
close document 1
quit
end tell
set movie_reference to save_location
tell application "iTunes"
launch
add movie_reference to playlist "Library" of source "Library"
delay 3
quit
end tell
tell application "Finder"
delete file movie_reference
end tell
end open
That script basically takes the movie file and saves a copy of it as a reference file which it then adds to itunes. No problems there, the script works fine except for the fact that it adds the extension .mov when i would like to replace the .avi ext of the movie to the .mov extension of the new reference file but whatever no big deal.
The problem I'm having is with Automator. I have automator set up to "Find Finder Items" in my Movies folder that were "created Today" and are of the "movie type." If those things prove true, it acts on the file/files with the Applescript application above.
But, obviously it will try to act on that same file/files continuously for the entire day...until the "created Today" aspect is no longer applicable.
How can I change it so that it will do what it's doing but WILL NOT act on the same file more than once?
Thanks for any help,
Matt
Also could there be a problem where the automator will act on the movie file before it has been transferred over to the Movies folder completely? I have transmission set up so that while it's downloading, the file is on the main hard drive in a Downloading folder. But once it has completed, transmission moves the file to the Movies folder which is on an external drive. Will the automator script, since it will be a plug-in acting on the Movies folder, act on the movie file before it has finished transferring from the main drive to the external? or will automator know to wait until it has finished?