[Added] New Batch Action: Do (not) export if RegEx (not) matching in absolute filepath

Want to submit a new feature, an enhancement ? Do it here !
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: New Batch Action: Do (not) export if RegEx (not) matching in absolute filepath

Post by porg »

@forum_adm : The leftover issues of the last post were not addressed by you. Please.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: New Batch Action: Do (not) export if RegEx (not) matching in absolute filepath

Post by forum_adm »

2) Can't be fixed due the internal code architecture, yet.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: New Batch Action: Do (not) export if RegEx (not) matching in absolute filepath

Post by forum_adm »

1+3) are changed with build 5678.
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: New Batch Action: Do (not) export if RegEx (not) matching in absolute filepath

Post by porg »

1) ✅ Parameter preview in the "Batch" pane of Convert & Modify now correctly ordered as:
• "x if src = myRegEx" as in "exclude if source matches myRegEx"
• "✓ if dest ≠ myRegEx" as in "include if destination does not match myRegEx"

Ad 3) ❌ My help text had two mistakes:
- Capitalization should be exactly like the action name: "Do or don't Export if RegEx"
- Sample RegEx /undesired/[^/]$ would only match single letter files, forgot the "+" symbol, should be: /undesired/[^/]+$

Please just copy/paste the corrected text block:
• Path is the entire absolute filepath, that is all folders from root "/" down until the filename, including its extension.
• ^ matches start of path, $ end of path, slash "/" must not be escaped, literal dot "." must be escaped.
• You can chain multiple "Do or don't Export if RegEx" actions in your batch.
• E.g. first an inclusive one like "export if regex matches" where all *.jpg *.jpeg *.png pass through, which then get narrowed down by an exclusive one like "do not export file if a certain folder name is anywhere in its path" or more specific like "one level above" e.g. /undesired/[^/]+$
• In your batch you are advised to put those filename/filepath filtering actions which result in a reduced source list on top and only later in your batch have the performance intensive actions such as "Scale" etc.

Ad 2) ❌ Avoid the creation of orphan folders at destination

Idea: If the current architecture cannot avoid to create them, we could quite cheaply achieve the desired outcome by a post batch cleanup script if the user activates it.

At the end of the dialog after the general hint would be the following two checkboxes in their default states as shown and with hint text below:


[ ] Delete orphaned folders [√] with a creation date after batch start
Note: After batch completion a cleanup script deletes any orphaned folder that it finds at the destination filepath and recursively below. GraphicConverter does not know whether an orphaned folder is a result of the RegEx filtering or if an orphaned folder has been there already. Activating "with a creation date after batch start" in 99% of the use cases matches those which are a result of the RegEx. Nevertheless. Use with care! Especially when the destination path has many folder levels below as it will recurse through all of them.
Last edited by porg on Tue Nov 29, 2022 8:31 pm, edited 1 time in total.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: New Batch Action: Do (not) export if RegEx (not) matching in absolute filepath

Post by forum_adm »

1) Did you remove and add the batch again?
Screenshot 2022-11-29 at 19.08.07.jpg
Screenshot 2022-11-29 at 19.08.07.jpg (24.29 KiB) Viewed 1001 times
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: New Batch Action: Do (not) export if RegEx (not) matching in absolute filepath

Post by forum_adm »

Add 3) I updated the text for the next BETA

Add 2) Not possible, yet.
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: New Batch Action: Do (not) export if RegEx (not) matching in absolute filepath

Post by porg »

Point 1 was meant just to confirm it is ok as it is now. My sample was "myRegEx" instead of the concrete Regex example "/[^/]*my-keyword[^/]*\.(png|jpe?g|webp|tiff)$". Sorry if that confused you. Both the order of the text-elements that make up the summary and also the sample RegEx are now all perfectly ok.

Point 3 on the other hand was a request to update a textblock. Would be nice to confirm whether you applied it or not. Instead of getting no answer and being left in doubt.

And regarding point 2 I brought up an alternative idea. But received no answer whatsoever. As always: An answer would be appreciated! Also if it is only a preliminary answer such as "I have to research regarding topic X to answer this" or "I have to take a closer look at it" or "I think rather not" or "No because X" or even a plain "No". All better than getting no answer at all on a concrete proposal/request point. Thanks for your understanding.
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: New Batch Action: Do (not) export if RegEx (not) matching in absolute filepath

Post by porg »

Ah I now saw that you answered 2+3 in a separate post (while I wrote my complaint of the lack of a response on these points).

If a post addresses multiple points, then please answer in a single post in which you address all points (fully or the unknown at least preliminarily).
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: New Batch Action: Do (not) export if RegEx (not) matching in absolute filepath

Post by porg »

Now that you answered the last open questions, I close this issue as [Added]

Followup: If you deem the avoidance/cleanup of orphan folders worth implementing, please you @forum_adm or anyone reading this open one or two followup issues publicly, with titles like:

• Batch system gets capability for post batch cleanup script
• Avoid creating orphan folders in batch action "Do (not) export if RegEx (not) matching filepath"

And link them here, as I remain subscribed to this issue here.
I would then subscribe to the followup issue and get notified whenever questions arise or quality assurance / feedback would be of help.
Post Reply