How do I add "Batch - Save to Destination Folder"? - RealWorld forums

Log-in or register.

How do I add "Batch - Save to Destination Folder"?

in RWIE
kunkel321
on November 15th 2012

Sorry for the dumb question...

I've noticed your "Hint" in the Batch dialog. I tried to use it with your Normalize script. I added it as the second sub-operation in the sequence (see img)
http://i.imgur.com/JSa2g.png
But I'm not sure what to do next...

I noticed that your Combine Icons script *does* prompt for a destination path, maybe it's the "var path = Configuration.path" line of code(?) Can I use that bit of code in the other scripts too?

Not a big deal, but it would save me from having to cut-n-paste from the output window :-)

Vlasta
on November 15th 2012

When the batch operation is run, the application:

  1. selects the next input file,
  2. reads the file,
  3. runs the batch operation.

There is no implicit save operation. The saving must be done inside the batch operation. In most cases, the "Batch - Save to Destination Folder" is the best candidate to perform this task (it saves files to a temporary folder using the original filename).

In the Combine Icons script, I am not using the "Batch ..." step, because I cannot. In this operation, I need to not only write to this folder, but I also need to read files from the folder (to combine new images with old images in the files).

So, using the "Batch - Save to Destination Folder" op is not mandatory, you can use something else to save the file. The JavaScript operation can be used instead to save a file with a code like this:

Document.SaveCopyAs("C:\\MyFolder\\"+Document.Name);

The double backslashes are needed, because backslash is an escape character in JavaScript. The piece of code you have mentioned is part of the popup configuration window. If you want to have a configuration window, you need to switch to the configuration tab and define an input field there. For example like this:

Configuration.AddEditBox(
	"path",
	"Destination path",
	"Folder for final icons. Set to C:\\Users\\<your_Windows_user_name>\\AppData\\Local\\Temp\\RWIE to put them in the default batch folder.",
	Configuration.GetValueOrDefault("path", "C:\\TEMP"));

When the field is defined, you can access the value selected by user with Configuration.path ("path" is a custom name defined as the first argument to AddEditBox).

Be careful though not to overwrite the source files if you don't want to lose them.

Page views: 1445       Posts: 2      
Select background
Vista & Win 7 icons
I wish there were...