Add the ability to launch into "Batch Convert" custom script

Ideas for improvements and requests for new features in XnView MP

Moderators: XnTriq, xnview

User avatar
xnview
Author of XnView
Posts: 32737
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Add the ability to launch into "Batch Convert" custom sc

Post by xnview » Tue Feb 18, 2020 3:37 pm

m.Th. wrote:
Sat Nov 30, 2019 9:44 am
In just one Batch we will
- generate all the image sizes of an application (small, medium, large etc.) to publish on Google Play, Apple Store, Windows Store etc.
- generate all the image sizes for a site (thumbnails, full, watermarked etc.)

We will have the following actions:

Resize to: Height = 1080

Custom Script: copy {filename} {filename_noExt}_screen

Resize to: 640

Custom Script: copy {filename} {filename_noExt}_640x320

Resize to: 128

Custom Script: copy {filename} {filename_noExt}_128x128

Something like this.
But in your example, you need to load different xbs scripts 3 times, right?
Pierre.

cday
XnThusiast
Posts: 2319
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Add the ability to launch into "Batch Convert" custom script

Post by cday » Wed Feb 19, 2020 6:30 pm

xnview wrote:
Tue Feb 18, 2020 3:37 pm
But in your example, you need to load different xbs scripts 3 times, right?
m.Th. wrote:
Sat Nov 30, 2019 9:44 am
Not quite.

3 different .bat scripts, (perhaps) yes. But it can be done in just one xbs having 3 times the Resize and 3 times the Custom Script action, if someone starts with Resize from the biggest dimension towards the smallest.
Currently Batch Convert can only produce one set of outputs when run, can a single xbs script launch Batch Convert three times to produce the three output batches required?

No problem using a multi-line NConvert .bat file, though...

User avatar
m.Th.
XnThusiast
Posts: 1583
Joined: Wed Aug 16, 2006 6:31 am
Contact:

Re: Add the ability to launch into "Batch Convert" custom script

Post by m.Th. » Thu Feb 20, 2020 11:44 am

cday wrote:
Wed Feb 19, 2020 6:30 pm
xnview wrote:
Tue Feb 18, 2020 3:37 pm
But in your example, you need to load different xbs scripts 3 times, right?
m.Th. wrote:
Sat Nov 30, 2019 9:44 am
Not quite.

3 different .bat scripts, (perhaps) yes. But it can be done in just one xbs having 3 times the Resize and 3 times the Custom Script action, if someone starts with Resize from the biggest dimension towards the smallest.
Currently Batch Convert can only produce one set of outputs when run, can a single xbs script launch Batch Convert three times to produce the three output batches required?

No problem using a multi-line NConvert .bat file, though...
Having Custom Shell .CMD/.BAT/.EXE files in Batch Convert means that in these .CMD files (for Windows) the user can do whatever he wants.

For example let's say that I have one .JPG. If I run it now through Batch Convert I will obtain one result.

If I add there a Custom .VBS (Visual Basic Script) with

for i=1 to 100
copy {Input_Filename} to {Input_Filename} & i
next

will output from its belly 100 files, outside of the 'regular' result file.
m. Th.

The Ascetic Experience - The best photos and texts from Holy Mountain (Athos)

- Dark Themed XnViewMP 0.90 64bit & XnView 2.00 x64 on Win7 x64 -

User avatar
xnview
Author of XnView
Posts: 32737
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Add the ability to launch into "Batch Convert" custom script

Post by xnview » Thu Feb 27, 2020 11:13 am

the custom script is executed for each files once conversion is finished, right?
Pierre.

User avatar
m.Th.
XnThusiast
Posts: 1583
Joined: Wed Aug 16, 2006 6:31 am
Contact:

Re: Add the ability to launch into "Batch Convert" custom script

Post by m.Th. » Thu Mar 12, 2020 5:59 pm

xnview wrote:
Thu Feb 27, 2020 11:13 am
the custom script is executed for each files once conversion is finished, right?
For each file at the place where is inserted in the „Actions” list. It is a problem for you to „take back” the resulted file in the memory?
m. Th.

The Ascetic Experience - The best photos and texts from Holy Mountain (Athos)

- Dark Themed XnViewMP 0.90 64bit & XnView 2.00 x64 on Win7 x64 -

Vaibhav Garg
Posts: 1
Joined: Fri Mar 13, 2020 11:12 am

Re: Add the ability to launch into "Batch Convert" custom script

Post by Vaibhav Garg » Fri Mar 13, 2020 11:17 am

Hi, I am using xnconvert from a quite long time and have being spending 30-40 mins getting the images converted to different pixels and sizes. Is there any JS script for the Xnconvert from which i can automate the process??

cday
XnThusiast
Posts: 2319
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Add the ability to launch into "Batch Convert" custom script

Post by cday » Fri Mar 13, 2020 11:46 am

Vaibhav Garg wrote:
Fri Mar 13, 2020 11:17 am
Hi, I am using xnconvert from a quite long time and have being spending 30-40 mins getting the images converted to different pixels and sizes. Is there any JS script for the Xnconvert from which i can automate the process??
On the Actions tab at bottom left, there is an option to save the existing settings so that they can be reloaded later, so you could save multiple settings files for the different pixels and sizes you need...

You could also in principle create multiple instances of XnConvert with different settings that are reloaded when they are opened.

Or, if you are familiar with using the command line, it would be possible to create an NConvert (the command line software) batch file .bat which could produce multiple versions of a set of input files in a single operation.

Post Reply