How do I use the filebot-watcher.ps1 script with a custom @file for command-line arguments?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Wirly
Posts: 9
Joined: 10 Aug 2020, 01:08

How do I use the filebot-watcher.ps1 script with a custom @file for command-line arguments?

Post by Wirly »

Thanks a bunch for these great scripts rednoah!

For anyone using the windows script, if you have all your AMC options saved in the @file syntax, you might want to edit line 17 of the filebot-watcher.ps1 script to remove unwanted options. Change Line 17 to...

Code: Select all

	& filebot @global:options | Write-Host
Since all your options are in the @file, you can then run the script and simply pass the options file...

Code: Select all

C:\Tools\filebot-watcher.ps1 "X:\path\to\monitored_folder" "@A:\path\to\amc-options.txt"
Thanks again rednoah, works great and is much cleaner than my current approach of blindly running the script every 3 minutes!
User avatar
rednoah
The Source
Posts: 23449
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: [DOCS] How do I monitor a folder and call filebot on newly added files?

Post by rednoah »

Wirly wrote: 15 Dec 2022, 22:04 For anyone using the windows script, if you have all your AMC options saved in the @file syntax, you might want to edit line 17 of the filebot-watcher.ps1 script to remove unwanted options. Change Line 17 to...

Code: Select all

	& filebot @global:options | Write-Host
Why would you want to do that though? You can just specify the options you prefer in your @file. You can overwrite a previously specified option, by specifying it again with a different option value. So what you're doing works by default, you just might have to explicitly enable / disable some options in your @file instead of omitting them.

e.g. use --action move

Code: Select all

.\filebot-watcher.ps1 X:\Input --output X:\Output --action move
e.g. --action move is used because it is the last occurrence of that option:

Code: Select all

filebot -script fn:amc --action duplicate ... --action move
:idea: Please read the FAQ and How to Request Help.
Post Reply