[Windows] Context Menu w/ Folder Watcher+Scripts Pack [1.8]

How-to guides, frequently asked questions, not-so-obvious features, etc
chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

Re: [Windows] Advanced Explorer Context Menu (GitHub Integra

Post by chest069 »

Ithiel wrote:@chest069

Are you still having this problem? If so, please let me know. Also, if just double clicking fails, does right clicking and running as administrator work?
Akki highlighted a compatibility tweak for the method I use to make the script seek admin privileges that I was planning on working into my next update.
I tried double clicking and that didn't work and I tried right clicking on it and choosing run as administrator as well and that didn't work. So I am at a loss on what to do to get this installed.

Also where is this located? "Akki highlighted a compatibility tweak for the method I use to make the script seek admin privileges that I was planning on working into my next update."
Last edited by bonelifer on 13 Jan 2014, 15:09, edited 1 time in total.
Reason: Fixed quote beginning tag
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Advanced Explorer Context Menu (GitHub Integra

Post by Ithiel »

UPDATE: FileBot Advanced Context Menu v1.3

New Features:
- Now Includes "FileBot Context Menu Subtitle Fetch Language Selector v1.1", which will be created in c:\program files\filebot\cmdlets

Improvements:
- Several compatibility fixes and improvements, particularly in regards to seeking elevated privileges.
- Tidied log files and coding up a little

----------------------------------------------

The script for upgrading the file to take admin privileges is now over 100 lines long in and of itself.

Process works a little like this:

Am I running as admin?
- If yes, continue
- If no, go check if I can write to the current directory
- Can I write to the temp directory?
-- If yes, write upgrade permissions script
-- Can I execute the script?
---- If yes, upgrade then continue
---- If no, go check if I can write to profile directory
-- If no, go check if I can write to profile directory
- Can I write to profile directory?
-- If yes, write upgrade permissions script
-- Can I execute the script?
---- If yes, upgrade then continue
---- If no, go check if I can write to temp directory
-- If no, go check if I can write to temp directory
- Can I write to the temp directory?
-- Can I execute the script?
---- If yes, upgrade then continue
---- If no, go to upgrade failure message
-- If no, go to upgrade failure message
- Display message informing users they must right click and run the file as an admin

... now, assuming I haven't made a hash of it somewhere, hopefully that should keep all the various incarnations of Windows happy :-)
There can be only one Power² User
chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

Re: [Windows] Advanced Explorer Context Menu (GitHub Integra

Post by chest069 »

Thanks for the update.

So here is my situation on installing this. I did get it installed but with a dirty way.

This is what I did to finally get it working since the other way would still not run for me.
I went to https://github.com/CapriciousSage/cmdlets and downloaded the zip file.
I then unzipped it and ran all the command files inside of it and then everything showed in the context menus of my Windows 7 64bit OS.

I tried downloading this again context_menu_live_installer.cmd but I ran into the same problems.
If I doubled clicked thefile I got a quick cmd window that popped up then closed and if I right clicked on it and said run as administrator I got a quick cmd window that popped up then closed and nothing else happened.

I also tried running this in a command window that was being run as administrator and got the following in the terminal window:
C:\>context_menu_live_installer.cmd <----- command I ran
The syntax of the command is incorrect. <-------- error it gave me
C:\><!DOCTYPE html>

So based on me running this in the cmd window it looks like it thinks it is a html file instead of a cmd file and it is possible that is why it wont run. I had to right click on the file to download it, is that the wrong way to download the file or am I missing some other step? Do I need git hub, etc.

I am at a loss on this but it is working for me but like I said I had to do it a dirty way to get it working. Thanks for any help on this.
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Advanced Explorer Context Menu (GitHub Integra

Post by Ithiel »

@chest069

That's not quite the way to download it, lol.

Righto...
1. Click this link: https://github.com/CapriciousSage/cmdle ... taller.cmd
2. It should ask you to save the file context_menu_live_installer.cmd somewhere.. Put it in your downloads directory or where ever (anywhere should be fine, just as long as it's away from wherever you tried to extract that zip file, lol)
3. Right click the file, go to properties, click 'Unblock', then 'OK'.
4. Double click the file and follow the prompts (it should run through the rest of the installer then).

When the first prompt comes up, I would recommend clicking the option to UNINSTALL first, just to clear out any guff that was created during previous attempts. :-)

After that, run it again, and it should all work ok.

Cheers,

~Ithiel

Edit: I've updated the instructions in the OP a little as well.
There can be only one Power² User
Ztrust
Posts: 69
Joined: 21 Dec 2013, 17:04

Re: [Windows] Advanced Explorer Context Menu (GitHub Integra

Post by Ztrust »

This is very nice and easy setup ;)
would it be possible to tell it to download both english and danish subs at the same time ?
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Advanced Explorer Context Menu (GitHub Integra

Post by Ithiel »

Hi Ztrust,

The FileBot CLI does not natively support downloading two subtitles in a single command, so you would need to modify the registry entries that are created to have it run two sequential commands. As the script doesn't support this 'out of the box', after installing, you will need to change the following two registry settings as follows:

Go To: HKEY_CLASSES_ROOT\FileBot\File_Menu\shell\002Fetch\shell\003Subtitles\command
Change the value of (default)..
From This: cmd /c filebot -get-subtitles "%1" -non-strict --lang en --log-file context.log
To This: cmd /c filebot -get-subtitles "%1" -non-strict --lang en --log-file context.log && filebot -get-subtitles "%1" -non-strict --lang da --log-file context.log

Go To: HKEY_CLASSES_ROOT\FileBot\Folder_Menu\shell\002Fetch\shell\003Subtitles\command
Change the value of (default)..
From This: cmd /c filebot -script fn:suball "%1" -non-strict --lang en --log-file context.log
To This: cmd /c filebot -script fn:suball "%1" -non-strict --lang en --log-file context.log && filebot -script fn:suball "%1" -non-strict --lang da --log-file context.log

Results: The "FileBot -> Fetch -> Subtitles with Language Tag" context menu for both file and folder scanning will download both English and Dainish subs and place them in the same folder as the media. Please note that both files will include their applicable language tag.

---------------------

Question: How big a need is multi-language subtitle downloads? What options do you need? Does there need to be an option to have the primary language not include a language tag?

I could extend the subtitle language tool to include multi-language support and what not, but it's a good couple of hours work to make sure all the options menus are working correctly, that the error handling goes the way its meant to, and that all the variations function and options work correctly... so I'd want to be certain its actually gonna get used, lol
There can be only one Power² User
Ztrust
Posts: 69
Joined: 21 Dec 2013, 17:04

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by Ztrust »

hey Ithiel

thanks for the reply.
your answer is something i can actually do by myself so I am very happy. Since everything about filebot is so very new to me all this coding and scripts its very complicated for me.

Regarding your question.
For me it is absolute I need both English and danish subtitles since I hate using Danish subtitle I always use English subs by myself, But most of my friends and family dont do english very well so i need Danish subs for when they are here.

And regarding tags me personelly I always append the .English and .Danish to my subs and set my players up to use the english sub.
But it might be a good idea as you say to have no tag on the primary subs. so it will always be loaded by default.
But I use my own naming scheme with your nifty tool so it handels the tagging. Btw Thanks for making it so easy to use own scheme ;)

But i think it would nice to be able to set secondary subtitle so when you do a fetch it gets both. But I dont know if dual subs is wiedely used. I have no understanding of coding or how hard it would be to implement but posible add it as an option in the installer.
chest069
Posts: 24
Joined: 01 Jan 2014, 11:09

Re: [Windows] Advanced Explorer Context Menu (GitHub Integra

Post by chest069 »

Thanks for the help, this worked for me and now every thing is working as it should.
Ithiel wrote:@chest069

That's not quite the way to download it, lol.

Righto...
1. Click this link: https://github.com/CapriciousSage/cmdle ... taller.cmd
2. It should ask you to save the file context_menu_live_installer.cmd somewhere.. Put it in your downloads directory or where ever (anywhere should be fine, just as long as it's away from wherever you tried to extract that zip file, lol)
3. Right click the file, go to properties, click 'Unblock', then 'OK'.
4. Double click the file and follow the prompts (it should run through the rest of the installer then).

When the first prompt comes up, I would recommend clicking the option to UNINSTALL first, just to clear out any guff that was created during previous attempts. :-)

After that, run it again, and it should all work ok.

Cheers,

~Ithiel

Edit: I've updated the instructions in the OP a little as well.
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by Ithiel »

Ztrust wrote:your answer is something i can actually do by myself so I am very happy ... But i think it would nice to be able to set secondary subtitle so when you do a fetch it gets both.
Glad it's working for you Ztrust :-)

If I get a chance this weekend, I'll try and extend the language changer script to also include support for additional subtitles. I've got a few ideas on how I can extend it to allow people to specify how many subtitle languages they want, but coding it in cmd is going to be a little interesting, haha. Oh well, that's what Saturday's are for, I guess ^.^
chest069 wrote:Thanks for the help, this worked for me and now every thing is working as it should.
Awesome! Thanks for letting me know it worked, the feedback is appreciated.
There can be only one Power² User
romano
Posts: 35
Joined: 11 Jan 2014, 12:26

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by romano »

Still give me the 401 unauthorized
Image
romano
Posts: 35
Joined: 11 Jan 2014, 12:26

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by romano »

Ithiel something is wrong with the cmd, it keeps opening and closing always, looking for "administrative privileges"

i had to download the zip to update. i did read instructions. :D but no harm done its installed :P
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by Ithiel »

Hi Romano,

With the first error (401 Unauthorized), that is an error with OpenSubtitles, not with the script itself. Can you try running the OpenSubtitles login script (would have been made in your cmdlets folder during install) and see if that makes a difference? You will need to register a free account on the OpenSubtitles.org website first though.

The error sounds like you may have either hit your daily limit or your IP had been banned. Hopefully logging into an account first may fix your problems.

Regarding the admin privileges issue - are you logged into your computer from an admin account? Also, does right clicking the file and going "run as administrator" help?

Can you please send me a PM with screenshots or a screen cast what steps you are taking, where you are running the files from, errors you see, and so on? The admin privileges upgrade script should work in just about every conceivable setup, so its most likely another program getting in the way, lol.

On that note, what antivirus are you using, and have you tried temporarily disabling it during install?
There can be only one Power² User
romano
Posts: 35
Joined: 11 Jan 2014, 12:26

Re: [Windows] Advanced Explorer Context Menu (GitHub Integra

Post by romano »

Ithiel wrote:Hi Ztrust,

The FileBot CLI does not natively support downloading two subtitles in a single command, so you would need to modify the registry entries that are created to have it run two sequential commands. As the script doesn't support this 'out of the box', after installing, you will need to change the following two registry settings as follows:

Go To: HKEY_CLASSES_ROOT\FileBot\File_Menu\shell\002Fetch\shell\003Subtitles\command
Change the value of (default)..
From This: cmd /c filebot -get-subtitles "%1" -non-strict --lang en --log-file context.log
To This: cmd /c filebot -get-subtitles "%1" -non-strict --lang en --log-file context.log && filebot -get-subtitles "%1" -non-strict --lang da --log-file context.log

Go To: HKEY_CLASSES_ROOT\FileBot\Folder_Menu\shell\002Fetch\shell\003Subtitles\command
Change the value of (default)..
From This: cmd /c filebot -script fn:suball "%1" -non-strict --lang en --log-file context.log
To This: cmd /c filebot -script fn:suball "%1" -non-strict --lang en --log-file context.log && filebot -script fn:suball "%1" -non-strict --lang da --log-file context.log

Results: The "FileBot -> Fetch -> Subtitles with Language Tag" context menu for both file and folder scanning will download both English and Dainish subs and place them in the same folder as the media. Please note that both files will include their applicable language tag.
Thank you it worked great, if the Portuguese Language isnt there it gets the English one, or both. :D
The 401 error is gone. Dont now why :roll:
romano
Posts: 35
Joined: 11 Jan 2014, 12:26

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by romano »

Ithiel can you put the rename music on the context also?
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by Ithiel »

UPDATE: 'Change Subtitle Fetch Language' v1.1
- Now includes support for multiple languages.

INSTRUCTIONS:
- When run, the script will ask how many subtitle languages you want. The default is 1.
- If you type in a number greater than one, you will be asked for their languages one at a time.
- First language entered is the 'primary' language, which will be the one 'without the language tag' if you so select that option.

HOW TO GET IT:
Option 1: Install/Reinstall using the live installer. The newest version of the script will be created in your cmdlets folder automatically.
Option 2: Download just the updated file from GitHub here - https://github.com/CapriciousSage/cmdle ... nguage.cmd

PLEASE NOTE: If you download the updated file directly, you will have to 'right click -> properties -> unblock' before use.

-------------------------------

@romano,

Re music integration - As FileBot doesn't really have a lot of support for music at the moment, I haven't done any testing at all on my end, so I wouldn't be confident that it would work reliably enough if I just 'stuck it in there'. Until there's a little more music integration built into FileBot, and I've had a little more time to fuddle about with it (both in building and testing schemes and in integrating them into a context menu), I won't be adding music support. Sorry :-/

-------------------------------

For those wondering - this context menu and scripts bundle has just just broken the 1700 lines mark. *yay!
So much for a quick "hey, I wonder if I can make a right click menu?" afternoon project, haha :-)

If anyone notices any bugs or runs into any errors installing/uninstalling or running any of the included scripts, please let me know the details on what happened/how, and I'll try and sort it out for you ASAP ^.^

Also, if you have found this script collection (or FileBot in general), please consider making a donation to FileBot via PayPal. Your contributions help keep the site alive, fund future development, help solve world hunger (one hungry uni-student at a time anyway), and enable rednoah to provide all that awesome support he's been dishing out over the last few years :-)
There can be only one Power² User
Ztrust
Posts: 69
Joined: 21 Dec 2013, 17:04

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by Ztrust »

wow fast update thanks alot ;D
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by Ithiel »

No worries mate - was an interesting problem to solve. It should support an unlimited number of languages, however I'd imagine if you tried setting it to 100 or something that the registry might get a bit snotty with a value that long, lol.

Basically, it updates the registry each time on the loop (ads the first language when you set that, adds the second when you set that, etc) rather than doing it all at the end in case the process is interrupted.

Test it out, see how it works, and let me know if you run into any issues. It does more than the manual edits I sent through the other day, and will replace the old values, so you're right to run this as long as the main script is 'installed'.

I went to send you a PM when I uploaded it, but was half asleep by that stage, and accidently sent it to Romano instead, lol. Oops >.<

-----------------------------------------------

Righto, aside from music (which isn't really on the cards for the time being - sorry) are there any other feature requests out there, or requests for other scripts to be included in the cmdlets collection? Also, has anyone come across any bugs in the latest version that need to be addressed?
There can be only one Power² User
SFW
Posts: 2
Joined: 23 Jan 2014, 15:14

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by SFW »

hey ithiel

how do i rename without having to move the file to another output folder

thanks to you and renoah for improving the app all the time
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by Ithiel »

Hi SWF,

It wasn't ever really designed with that in mind, but there are two ways you can make it work (both require some manual tinkering though):

OPTION 1: If you're renaming local files, the easiest way is to just edit output.txt file and change the first 3 lines to this:

Code: Select all

.\
.\
.\
This will work for LOCAL FILES ONLY. If you try UNC or Network Path, funky things will happen. You can either edit output.txt (in c:\program files\FileBot\cmdlets\) directly, or uninstall/reinstall, and enter <em>.\</em> when prompted for the three paths.

OPTION 2: If you want it to work for UNC paths as well, you'll need to uninstall/install with the 'local' option (to create the .groovy files in your c:\program files\FileBot\cmdlets\ folder), then edit the newly created movies.groovy, anime.groovy, and tv_shows.groovy and change line 13:

From this:

Code: Select all

rename(file:input, format:format, output:output)
To this:

Code: Select all

rename(file:input, format:format)
This seems to work for both local and UNC paths, but it might be a bit hit-or-miss with mapped network drives.
There can be only one Power² User
romano
Posts: 35
Joined: 11 Jan 2014, 12:26

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by romano »

Thank you best tool ever.
One thing if i put pt(Portuguese language) it will fetch all of Portuguese languages or only from Portugal? i will liked to fetch from Brasil also.
katates
Power User
Posts: 24
Joined: 26 Jan 2014, 18:41

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by katates »

Hey, i just installed it but I am having some troubles

It's not removing language tag. Only when I drag srt to the bat file.

Also I cant login to opensubtitles when I click bat file It showes up and closes itself

and is it possible to hide the cmd window when fetching subtitle? thanks
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by Ithiel »

@romano,

To fetch multiple subtitle languages, after you have installed the script (doesn't matter what you set the Lang as during install), go to c:\program files\cmdlets and run the new file there called change_subtitle_fetch_language.cmd.

This will ask you how many subtitle languages you want to fetch, then it will ask you for the language codes of each language you want. First language code will be the "primary" (the one without the language tag if you select the no language tag version).

@katates,

Easiest way to avoid the language tag is to select the 'Without language tag' option when fetching subtitles. If you have setup multiple languages, when selecting 'without language tag', the primary language will have no language tag, but others will (otherwise you would have duplicate files).

The drag and drop script in the cmdlets folder will try and rename files with the tag when you drag and drop the srt files on the bat file in explorer, but it will fail on conflict (I.e. Same file name already exists), and explorer limitations cap it at renaming about 15 at once. If you need to remove the language tag from a massive number of files, I came up with a slightly-ham-handed (but still effective) way of doing that here (I used this for over 5000 files.. Took hours, but it worked):

http://www.filebot.net/forums/viewtopic ... +tag#p7442

For the open subtitles login file, try right clicking -> run as administrator.

As for the cmd window, sorry, can't really hide it - but that has a silver lining.. You can tell what's happening, and tell if it worked, lol.
There can be only one Power² User
katates
Power User
Posts: 24
Joined: 26 Jan 2014, 18:41

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by katates »

@Ithiel

Without language tag option is not working. Its downloading with language tag.
And tried run as administrator but still same also it says failed or something I couldn't read it.
User avatar
Ithiel
Power² User
Posts: 204
Joined: 11 Jul 2013, 14:58

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by Ithiel »

Ah.. That probably means you're not running the latest jar, lol

There should have been an filebot auto jar updater cmf file included in the cmdlets folder after installing the context menu - please try running that, and it will download the newest build of FileBot for you.

Try that and let me know how it works after that :-)
There can be only one Power² User
katates
Power User
Posts: 24
Joined: 26 Jan 2014, 18:41

Re: [Windows] Advanced Context Menu & Cool Scripts Pack

Post by katates »

Its working now thanks! Is it possible to add primary language and secondary language.
If filebot couldn't found primary, I want it to download secondary language?
Post Reply