Auto Process File Upon Entering Folder?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
elgrayso
Posts: 7
Joined: 15 May 2015, 02:39

Auto Process File Upon Entering Folder?

Post 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! ;-)
User avatar
rednoah
The Source
Posts: 23097
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Auto Process File Upon Entering Folder?

Post 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
:idea: Please read the FAQ and How to Request Help.
gardnerd4me
Posts: 9
Joined: 21 Oct 2014, 04:36

Re: Auto Process File Upon Entering Folder?

Post 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).
elgrayso
Posts: 7
Joined: 15 May 2015, 02:39

Re: Auto Process File Upon Entering Folder?

Post by elgrayso »

thank you for your reply. I was actually able to figure out the command line and get it working with Hazel :-)
Post Reply