Page 1 of 1

Auto Process File Upon Entering Folder?

Posted: 16 May 2015, 02:51
by elgrayso
When my downloads are finished, I manually drag them into a "complete movies" folder or the "complete television" folder. I then batch process a group of them later in time.
I was wondering if there is a way of automating it to where any file that goes into the "complete movies" folder gets my movie file processing in FileBot. I also have OSX software "Hazel" which processes things like this, but I wasn't able to find out if they can work together.

PS: I know this must have been brought up before but I can't find the thread on it! ;-)

Re: Auto Process File Upon Entering Folder?

Posted: 16 May 2015, 07:43
by rednoah
1)
Since filebot (brew cask) can be called from the command-line, and since Hazel can call command-line tools, it's probably not too hard.

2)
There is LOTS of information on how to use filebot from the command-line here and elsewhere.

@see http://www.filebot.net/cli.html

Re: Auto Process File Upon Entering Folder?

Posted: 26 May 2015, 08:40
by gardnerd4me
elgrayso wrote:When my downloads are finished, I manually drag them into a "complete movies" folder or the "complete television" folder. I then batch process a group of them later in time.
I was wondering if there is a way of automating it to where any file that goes into the "complete movies" folder gets my movie file processing in FileBot. I also have OSX software "Hazel" which processes things like this, but I wasn't able to find out if they can work together.

PS: I know this must have been brought up before but I can't find the thread on it! ;-)
I don't use Hazel, but it can make a plist for launchagents that is easy enough to call a script from. Let launchd do all the work.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
     <key>Label</key>
     <string>com.myXX</string>
     <key>ProgramArguments</key>
     <array>
          <string>osascript</string>
          <string>/Users/XX/Documents/Scripts/myXX.scpt</string>
     </array>
     <key>WatchPaths</key>
     <array>
           <string>/Users/XX/Sites/XX/</string>
     </array>
</dict>
</plist>
You can easily swap out WatchPaths for WatchFolders if you would rather it only look for new items rather than changed items. But if you do that, you may as well use folder actions instead. Less work to call a script. Obviously replace XX with whatever applies and change paths to whatever applies. The last string is the location to monitor. The third string is the location of the script you want to call (may be a .sh). Easy enough to modify it to your needs. Save the file with whatever you name the first string and add .plist extension, then place it in your ~/Library/LaunchAgents folder and logout/login (or use launchctl load + path to your plist).

Re: Auto Process File Upon Entering Folder?

Posted: 26 May 2015, 17:30
by elgrayso
thank you for your reply. I was actually able to figure out the command line and get it working with Hazel :-)