Search found 147 matches

by Wolfie
Yesterday, 04:36
Forum: Scripting and Automation
Topic: Look who's back, back again... Match array entry based on minimum runtime?
Replies: 4
Views: 206

Re: Look who's back, back again... Match array entry based on minimum runtime?

Even better. I didn't know how to do it to integer, and yes, definitely better than comparing strings when dealing with numbers.

Thanks.
by Wolfie
04 May 2026, 07:04
Forum: Scripting and Automation
Topic: Look who's back, back again... Match array entry based on minimum runtime?
Replies: 4
Views: 206

Re: Look who's back, back again... Match array entry based on minimum runtime?


array.findResult{ k, v -> minutes.toString() >= k ? k : null }

This worked. I prefer the key, as the key is... well... the key to what I needed. :D

Having the key (minutes) allows me to use it beyond that one part, and can easily get the value.

The movie is Superman (1978, not the joke that ...
by Wolfie
03 May 2026, 07:04
Forum: Scripting and Automation
Topic: Look who's back, back again... Match array entry based on minimum runtime?
Replies: 4
Views: 206

Look who's back, back again... Match array entry based on minimum runtime?

I'll make this simple, I hope...

array:[
"188" : "Extended",
"151" : 'Special",
]

Is there a way to match it so that it "hits" when the runtime matches or exceeds the number of minutes (on the left)?

I have a 188 minute version that is being detected as 189 minutes.

I'm not opposed to ...
by Wolfie
20 Aug 2025, 06:27
Forum: Help and Support
Topic: Having a brainfart moment. (Get key from array match.)
Replies: 15
Views: 47475

Re: Having a brainfart moment. (Get key from array match.)

And another tweak to account for the potential problem. So idea is still on. 😁
by Wolfie
20 Aug 2025, 04:32
Forum: Help and Support
Topic: Having a brainfart moment. (Get key from array match.)
Replies: 15
Views: 47475

Re: Having a brainfart moment. (Get key from array match.)

Tweaked it to just be variable.(property) instead of branching it. Rethinking the idea though, as I noticed a potential problem, but not giving up on what you taught me. It's quite useful.
by Wolfie
20 Aug 2025, 04:30
Forum: Help and Support
Topic: Is there a list of the colors/styles for the built-in editor?
Replies: 11
Views: 36748

Re: Is there a list of the colors/styles for the built-in editor?

Oh geez, I created a monster. lol

Perhaps make it a toggle (off by default unless an option used in command line when launching it)? The implementation (not your fault) is annoying.
by Wolfie
20 Aug 2025, 00:05
Forum: Help and Support
Topic: Is there a list of the colors/styles for the built-in editor?
Replies: 11
Views: 36748

Re: Is there a list of the colors/styles for the built-in editor?

Is there a way to make it only do it if the enter word is highlighted?
by Wolfie
19 Aug 2025, 13:06
Forum: Help and Support
Topic: Having a brainfart moment. (Get key from array match.)
Replies: 15
Views: 47475

Re: Having a brainfart moment. (Get key from array match.)

When I try to get it into a variable (not return the result as final), it doesn't want to work for me. ☹

The idea is to get it so that a single variable can be used to either get the "group" it match (a1, a2, a3), the key (a11, a12, etc), or the value (regex32) as desired. It's similar to the above ...
by Wolfie
19 Aug 2025, 12:19
Forum: Help and Support
Topic: Having a brainfart moment. (Get key from array match.)
Replies: 15
Views: 47475

Re: Having a brainfart moment. (Get key from array match.)

Any way to get it to return an array? So that the following is the result...

Code: Select all

result.key = "a3"
result.value = {"a32":"regex32"}
result.value.key = "a32"
result.value.value = "regex32"
by Wolfie
19 Aug 2025, 01:17
Forum: Help and Support
Topic: Having a brainfart moment. (Get key from array match.)
Replies: 15
Views: 47475

Re: Having a brainfart moment. (Get key from array match.)

Here's one for you. How do I do something like this:

array.find{ k,v -> v.find{ p,regex -> value=~regex} }

Imagine an array like:

"arrayT":[
"a1":[ "a11":"regex11", "a12":"regex12", ],
"a2":[ "a21":"regex21", "a22":"regex22", ],
"a3":[ "a31":"regex31", "a32":"regex32", ],
],

When I try to ...
by Wolfie
18 Aug 2025, 21:11
Forum: Help and Support
Topic: Is there a list of the colors/styles for the built-in editor?
Replies: 11
Views: 36748

Re: Is there a list of the colors/styles for the built-in editor?


I'll see about enabling the "Mark Occurrences" in the RSyntaxTextArea component we are using. I'm not sure as it will add complexity and make the format editor even more daunting to new users, but perhaps it's a good idea to just enable it for the next release and see what comes back from our ...
by Wolfie
18 Aug 2025, 06:04
Forum: Help and Support
Topic: Is there a list of the colors/styles for the built-in editor?
Replies: 11
Views: 36748

Re: Is there a list of the colors/styles for the built-in editor?

I'll take a look at it. I like Notepad++ because I can double click a word and it'll highlight all instances of it. Helps to show me how many times I'm using a variable assignment (for example) to know if it's worth it or not. Don't suppose you could work that into the Filebot editor? lol... Double ...
by Wolfie
17 Aug 2025, 22:43
Forum: Help and Support
Topic: Is there a list of the colors/styles for the built-in editor?
Replies: 11
Views: 36748

Re: Is there a list of the colors/styles for the built-in editor?

Thanks. Trying to configure Notepad++ to use similar colors when selecting "Filebot" as the language. (I know it's not an actual language, but it's just for cosmetics.)
by Wolfie
17 Aug 2025, 17:30
Forum: Help and Support
Topic: Is there a list of the colors/styles for the built-in editor?
Replies: 11
Views: 36748

Is there a list of the colors/styles for the built-in editor?

Like 'def' and 'return' being a dark pink/purple, etc. Wondering where the codes are for that. 😁
by Wolfie
16 Aug 2025, 18:43
Forum: Help and Support
Topic: Having a brainfart moment. (Get key from array match.)
Replies: 15
Views: 47475

Re: Having a brainfart moment. (Get key from array match.)

I'm trying to get it to match the '/' in "A:/" to limit it to a single folder name. Trying to make sure it matches the "_02" in "/_02/" and not in a situation like "part_023" for example.
by Wolfie
16 Aug 2025, 08:23
Forum: Help and Support
Topic: Having a brainfart moment. (Get key from array match.)
Replies: 15
Views: 47475

Re: Having a brainfart moment. (Get key from array match.)

Now here's an interesting situation that is baffling me.

Using the 'folders' array from above ("01" = "_01", etc), I'm able to get results from one method but not another.

Working:
folders[file.path.match("(?<=\\_)(${folders.keySet().join('|')})")]

Not working:
folders[file.path.match ...
by Wolfie
16 Aug 2025, 05:39
Forum: Help and Support
Topic: Having a brainfart moment. (Get key from array match.)
Replies: 15
Views: 47475

Re: Having a brainfart moment. (Get key from array match.)

Here's some code and data that I hope will help others.

def root="P:"
config="P:/FileBot/"

def maps = include config+"config.groovy"
def map = maps['DEFAULTS'] + maps['TV'], folders=map['folders'], dd=map['dd'], talkshows=map['talkshows'], anime=(anime ? (map['anime'] ? "ANIME" : null) :null ...
by Wolfie
16 Aug 2025, 02:00
Forum: Help and Support
Topic: Having a brainfart moment. (Get key from array match.)
Replies: 15
Views: 47475

Re: Having a brainfart moment. (Get key from array match.)

Nevermind. 🤦‍♂️

Decided to actually try using Google and found the answer.

Groovy: Select all

return franchise.find{k,v-> fn=~v }.key
At least I hope that's right.
by Wolfie
16 Aug 2025, 01:40
Forum: Help and Support
Topic: Having a brainfart moment. (Get key from array match.)
Replies: 15
Views: 47475

Having a brainfart moment. (Get key from array match.)

Episodes (not movies).

Want to use an array (simple example):
franchise = [
"StarTrek" = "Star ?Trek",
"StarWars" = "Star ?Wars|(The ?)?Mandelorian|Obi-?Wan ?Kenobi",
],

When looking at the title of the file, return the key of the value that matches (if any).

Goal is to allow put grouped ...
by Wolfie
24 Jul 2024, 06:31
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 42625

Re: How do I read a file into a variable?

Format: Select all

return /\d/
Returns /d

Same if I do '\\d' or "\\d"
by Wolfie
24 Jul 2024, 01:14
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 42625

Re: How do I read a file into a variable?

Trying to do it for regex purposes, like "\d" to match a digit.
by Wolfie
23 Jul 2024, 18:18
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 42625

Re: How do I read a file into a variable?

Okay... how do I get a backslash to stay a backslash when it's not being used in a pathname? No matter what I try, "\" is being changed to "/" when I need it to remain a "\."
by Wolfie
23 Jul 2024, 08:00
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 42625

Re: How do I read a file into a variable?

rednoah wrote: 23 Jul 2024, 07:59 Cheers to that! 🍻
Found it...

viewtopic.php?p=22576#p22576
by Wolfie
23 Jul 2024, 07:52
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 42625

Re: How do I read a file into a variable?

Using @lines already. But I might swap the order of how it's working. Idea is that sometimes, movies aren't considered part of a collection even though they should be. Not FileBot's fault, of course, as it's relying on the information it grabs. So idea is to allow for fixing that, or for overriding ...
by Wolfie
23 Jul 2024, 07:00
Forum: Scripting and Automation
Topic: How do I read a file into a variable?
Replies: 21
Views: 42625

Re: How do I read a file into a variable?



Doesn't that make it more complicated with having to use {}'s and []'s?

Groovy syntax is definitely more complicated than JSON syntax, because the former does a lot more, and the latter is just meant to be a simple structured data notation. That said, you can use whatever works best for you ...