Adding Filebot to Services (Mac OSX)

All your suggestions, requests and ideas for future development
Post Reply
botuser
Posts: 10
Joined: 28 Jan 2019, 02:50

Adding Filebot to Services (Mac OSX)

Post by botuser » 28 Jan 2019, 02:53

Hi,

Is there a way to add Filebot to the Services right-click menu? This would be a great feature so you can quickly start Filebot from a folder in Finder.

User avatar
rednoah
The Source
Posts: 16985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding Filebot to Services (Mac OSX)

Post by rednoah » 28 Jan 2019, 08:48

Yes. Here's a detailed tutorial:
viewtopic.php?f=4&t=3908

Image
:idea: Please read the FAQ and How to Request Help.

botuser
Posts: 10
Joined: 28 Jan 2019, 02:50

Re: Adding Filebot to Services (Mac OSX)

Post by botuser » 29 Jan 2019, 01:23

Thanks - I followed the instructions, noting the twist to select Service at the beginning. When I try and import to Filebot via services I get this error. Any ideas?

Image

User avatar
rednoah
The Source
Posts: 16985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding Filebot to Services (Mac OSX)

Post by rednoah » 29 Jan 2019, 06:00

How did you install FileBot? You'll want to use the self-contained *.pkg installer to avoid compatibility issues.
:idea: Please read the FAQ and How to Request Help.

botuser
Posts: 10
Joined: 28 Jan 2019, 02:50

Re: Adding Filebot to Services (Mac OSX)

Post by botuser » 03 Feb 2019, 12:11

rednoah wrote:
29 Jan 2019, 06:00
How did you install FileBot? You'll want to use the self-contained *.pkg installer to avoid compatibility issues.
Yes I did use the *.pkg installer as I purchased a one year license. Is there a reason why this feature isn't built into the app?

User avatar
rednoah
The Source
Posts: 16985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding Filebot to Services (Mac OSX)

Post by rednoah » 03 Feb 2019, 12:30

1.
Please open Terminal, execute this command, and then post the output:

Code: Select all

/usr/local/bin/filebot -version

2.
If you can use the command-line, then you can make your own services, for filebot, or any other command-line tool. FileBot can't know which service you may or may not like to have, and what customizations you want for each of your services. By creating a service yourself, you'll understand how it works, and you'll be able to customize by yourself as well.
:idea: Please read the FAQ and How to Request Help.

botuser
Posts: 10
Joined: 28 Jan 2019, 02:50

Re: Adding Filebot to Services (Mac OSX)

Post by botuser » 03 Feb 2019, 12:32

Ah ok - understood.

Here's the output:

Code: Select all

$ /usr/local/bin/filebot -version
FileBot 4.8.2 (r5789) / OpenJDK Runtime Environment 11.0.2 / Mac OS X 10.13.6 (x86_64)

User avatar
rednoah
The Source
Posts: 16985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding Filebot to Services (Mac OSX)

Post by rednoah » 03 Feb 2019, 13:11

That looks good.


Let's try a script:

Code: Select all

/usr/local/bin/filebot -script fn:sysinfo

And then let's try the amc script:

Code: Select all

/usr/local/bin/filebot -script fn:amc
:idea: It'll error out because we don't pass any input / output folders, but that's fine, since we wanna make sure that we can in fact execute the script without getting some kind of "semantic analysis" error.



EDIT:

What! That's actually not OK! FileBot 4.8.2 came out a half a year before Java 11.0.2 so that version output doesn't make sense. Are you sure you didn't also install via brew cask?

What does this say?

Code: Select all

ls -l /usr/local/bin/filebot
:idea: Please read the FAQ and How to Request Help.

botuser
Posts: 10
Joined: 28 Jan 2019, 02:50

Re: Adding Filebot to Services (Mac OSX)

Post by botuser » 03 Feb 2019, 13:22

Appreciate you taking the time to help!

Here are the results:

Code: Select all

$ /usr/local/bin/filebot -script fn:sysinfo
BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy' null
BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy' null
	at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:64)
	at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:74)
	at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:154)
	at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:36)
	at net.filebot.Main.main(Main.java:131)
Caused by: java.lang.UnsupportedOperationException
	at groovyjarjarasm.asm.ClassVisitor.visitNestMemberExperimental(ClassVisitor.java:248)
	at groovyjarjarasm.asm.ClassReader.accept(ClassReader.java:651)
	at groovyjarjarasm.asm.ClassReader.accept(ClassReader.java:391)
	... 5 more

Code: Select all

$ /usr/local/bin/filebot -script fn:amc
BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy' null
BUG! exception in phase 'semantic analysis' in source unit 'Script1.groovy' null
	at net.filebot.cli.ScriptShell.evaluate(ScriptShell.java:64)
	at net.filebot.cli.ScriptShell.runScript(ScriptShell.java:74)
	at net.filebot.cli.ArgumentProcessor.runScript(ArgumentProcessor.java:154)
	at net.filebot.cli.ArgumentProcessor.run(ArgumentProcessor.java:36)
	at net.filebot.Main.main(Main.java:131)
Caused by: java.lang.UnsupportedOperationException
	at groovyjarjarasm.asm.ClassVisitor.visitNestMemberExperimental(ClassVisitor.java:248)
	at groovyjarjarasm.asm.ClassReader.accept(ClassReader.java:651)
	at groovyjarjarasm.asm.ClassReader.accept(ClassReader.java:391)
	... 5 more

botuser
Posts: 10
Joined: 28 Jan 2019, 02:50

Re: Adding Filebot to Services (Mac OSX)

Post by botuser » 03 Feb 2019, 13:26

Sorry just saw your last edit - here's the result from the other command:

Code: Select all

$ ls -l /usr/local/bin/filebot
lrwxr-xr-x  1 selector  admin  66 Jan 28 20:12 /usr/local/bin/filebot -> /Users/selector/Applications/FileBot.app/Contents/MacOS/filebot.sh
So I followed the instructions on the post exactly and clicked on the link to install the command tools as it didn't look like I had them installed from this post.

User avatar
rednoah
The Source
Posts: 16985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding Filebot to Services (Mac OSX)

Post by rednoah » 03 Feb 2019, 13:27

Yep, you're running FileBot 4.8.2 with Java 11.0.2 which isn't compatible, which means you have installed the APP package (as opposed to the PKG package) which uses the Java runtime installed on your system.


If you use the PKG installer package (as opposed to the APP package) then it'll be running with the included Java 10 JRE and it'll work:

Code: Select all

filebot -version
FileBot 4.8.2 (r5789) / Java(TM) SE Runtime Environment 10.0.2 / Mac OS X 10.14.2 (x86_64)

:idea: When in doubt, uninstall all versions of FileBot that you have installed, confirm that the "filebot" command no longer works and says "command not found" and then ONLY install via the PKG installer package.
:idea: Please read the FAQ and How to Request Help.

botuser
Posts: 10
Joined: 28 Jan 2019, 02:50

Re: Adding Filebot to Services (Mac OSX)

Post by botuser » 03 Feb 2019, 13:30

Ok thank you! - what is the best way to uninstall? Just delete Filebot from Applications?

User avatar
rednoah
The Source
Posts: 16985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding Filebot to Services (Mac OSX)

Post by rednoah » 03 Feb 2019, 13:41

1.
Uninstall the APP package you've installed via brew accidentally:

Code: Select all

brew cask uninstall filebot --appdir=~/Applications

2.
Install the PKG package by clicking on the download link and then double clicking the the PKG file:
https://get.filebot.net/filebot/FileBot ... _4.8.2.pkg
:idea: Please read the FAQ and How to Request Help.

botuser
Posts: 10
Joined: 28 Jan 2019, 02:50

Re: Adding Filebot to Services (Mac OSX)

Post by botuser » 03 Feb 2019, 13:56

Thanks - do I need to recreate the Services Automator script? Because at the moment when I try it now I get this message:

Image

Also I did set the Automator script to be available in any applications but it only appears when in Finder:

Image

The command line seems to be working ok:

Code: Select all

$ /usr/local/bin/filebot -script fn:sysinfo
FileBot 4.8.2 (r5789)
JNA Native: 5.2.2
MediaInfo: 18.05
7-Zip-JBinding: 9.20
Chromaprint: 1.4.2
Extended Attributes: OK
Unicode Filesystem: OK
Script Bundle: 2019-02-02 (r543)
Groovy: 2.5.1
JRE: Java(TM) SE Runtime Environment 10.0.2
JVM: 64-bit Java HotSpot(TM) 64-Bit Server VM
CPU/MEM: 8 Core / 4 GB Max Memory / 35 MB Used Memory
OS: Mac OS X (x86_64)
HW: Darwin MMTV2.local 17.7.0 Darwin Kernel Version 17.7.0: Thu Dec 20 21:47:19 PST 2018; root:xnu-4570.71.22~1/RELEASE_X86_64 x86_64
DATA: /Users/selector/.filebot
Package: PKG
License: FileBot License P6792010 (Valid-Until: 2020-01-22)
Done ヾ(@⌒ー⌒@)ノ

Code: Select all

$ /usr/local/bin/filebot -script fn:amc
Run script [fn:amc] at [Sun Feb 03 08:52:33 EST 2019]
Illegal usage: no input
Failure (°_°)

User avatar
rednoah
The Source
Posts: 16985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding Filebot to Services (Mac OSX)

Post by rednoah » 03 Feb 2019, 14:36

Yes, now it's working as expected. Automator is working. FileBot is working. FileBot is telling you that it does expect a valid existing output folder.

You can either change the --output value to a folder path that exists, or create a folder called Media in your user home:

Code: Select all

--output "$HOME/Media"
:idea: Please read the FAQ and How to Request Help.

botuser
Posts: 10
Joined: 28 Jan 2019, 02:50

Re: Adding Filebot to Services (Mac OSX)

Post by botuser » 12 Feb 2019, 03:14

Thanks I have corrected that and pointed it to an existing folder. However, now when I right click in Finder and under Services choose "Open with Filebot" nothing happens.

Also I thought by selecting "Any Application" in Automator the option would appear in other apps. I use Path Finder to manage files and the option does not appear in Services when right clicking a folder. Any idea why that happens?

User avatar
rednoah
The Source
Posts: 16985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding Filebot to Services (Mac OSX)

Post by rednoah » 12 Feb 2019, 04:22

1.
Since we're running a script, it'll merrily run in background without showing any kind of UI. You'll have to look at the log to see what it's doing or not doing.

If you specify --log-file amc.log then the amc.log log file will be at:

Code: Select all

$HOME/.filebot/logs

2.
Well, any application that supports Automator workflows. If Path Finder doesn't support Automator workflows, then you can ask the authors to add support.

Alternatively, most 3rd party file managers have their own "call command on selected files" kind of feature.
:idea: Please read the FAQ and How to Request Help.

botuser
Posts: 10
Joined: 28 Jan 2019, 02:50

Re: Adding Filebot to Services (Mac OSX)

Post by botuser » 12 Feb 2019, 04:38

1. Ok, I thought adding the Services option would open up Filebot and load the files in that folder into Filebot ready to select options to process. I was comparing it to how Better Rename does this quite nicely and has the option to add the service feature in their app under options without having to play with Automator. Is there no way to replicate that functionality?

I checked the amc.log and can now see what happened. It did parse the folder but treated my TV show as a movie and named it accordingly which was a mismatch as a result.

2. Apologies for my lack of knowledge but are Automator workflows a special type of "Service"? Path Finder does list other Services but just doesn't show this one (Open with Filebot)

User avatar
rednoah
The Source
Posts: 16985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding Filebot to Services (Mac OSX)

Post by rednoah » 12 Feb 2019, 04:51

1.
I'm not familiar with Better Rename, so I'm not sure what you're looking for. Maybe screenshots will help?


2.
If you want to just open the app and pass in certain files, then you can do that with literally any single macOS application.

e.g.

Code: Select all

open -a FileBot ~/Downloads

Code: Select all

open -a TextEdit ~/.filebot/logs/amc.log
Since we've already learned how to use Automator, we can easily make a service / workflow for FileBot or literally any other application:

Code: Select all

open -a FileBot "[email protected]"

3.
Please post the amc log so I can have a look at the log:
viewtopic.php?f=5&t=1868

:idea: If you are using a folder called "Movies" for your TV Shows, then that will force FileBot to interpret every file as Movie instead of being smart about it.


4.
No idea. It's an Apple thing, so naturally it works best with Apple software, such as Finder, and 3rd party software may not support it well or at all.

Best to ask the Path Finder people for advice on how to best integrate 3rd party tools with their file manager.
:idea: Please read the FAQ and How to Request Help.

User avatar
rednoah
The Source
Posts: 16985
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Adding Filebot to Services (Mac OSX)

Post by rednoah » 20 Feb 2019, 23:35

The next release will include some helper menu items to get you started with sample / default quick actions or folder actions.

Image
:idea: Please read the FAQ and How to Request Help.

Post Reply