This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > PainShop Pro Scripting > January 2007 > JPEGOptimizer Filename
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
JPEGOptimizer Filename
|
|
| cbaker 2007-01-16, 1:23 pm |
| I am trying use JPEG Optimizer in a script. How can I get it to not pop up the dialog that asks for the save file name and just use the batch file names. (I've tried silent mode and that doesn't seem to work) Thanks.
# JPEG Optimizer
App.Do( Environment, 'JPEGOptimizer', {
'Format': App.Constants.JpegFormat.Standard,
'Compression': 20,
'FileName': u'',
'BackgroundColor': (255,255,255),
'ChromaSubSampling': App.Constants.ChromaSubSampling.YCC_1x1_1x1_1x1,
'SaveExifData': False,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Silent,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((10,0,0),1)
}
}) | |
| Spandex Rutabaga 2007-01-30, 10:09 am |
| cbaker wrote:
>
> I am trying use JPEG Optimizer in a script.
Why? I ask because the File > Batch > Process mechanism includes
all the stuff that opens and saves files for you so it is usually
more convenient to use that than try to do your own file saving.
> How can I get it to not pop
> up the dialog that asks for the save file name
I don't think you can do that. The Optimizer dialog is designed
to be interactive. You seem to be asking for it to be interactive
and simultaneously not interactive depending on which aspect of
the dialog you are dealing with. The Silent execution mode makes
all of the command silent, not just part of it. The Interactive
mode makes all of the command interactive, not just part of it.
> and just use the batch
> file names.
I think you can use the Scripting API to return the name of the
image from the image information. Then you can put this name in
place of C:\MyPath\MyImage.jpg in the command to be executed
simply by specifying the file name as a variable rather than a
text string. However, you would have to run the command as Silent,
which offers no advantage over using the File > Batch Process
save mechanism with the JPEG options specified with the Options
button.
App.Do( Environment, 'JPEGOptimizer', {
'Format': App.Constants.JpegFormat.Standard,
'Compression': 25,
'FileName': u'C:\\MyPath\\MyImage.jpg',
'BackgroundColor': (255,255,255),
'ChromaSubSampling':
App.Constants.ChromaSubSampling.YCC_1x1_1x1_1x1,
'SaveExifData': False,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Silent,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})
| |
| SuzShook 2007-01-30, 10:09 am |
| I think you might want to remove the JPEGOptimizer step from the script, and
use the Save Mode panel of the Batch Process dialog to choose the type -
choose "New Type", then choose JPEG in the Type drop-list, and use the
Options button to set the JPEG save options. This should do the trick. Suz
cbaker wrote:
> I am trying use JPEG Optimizer in a script. How can I get it to not
> pop up the dialog that asks for the save file name and just use the
> batch file names. (I've tried silent mode and that doesn't seem to
> work) Thanks.
>
> # JPEG Optimizer
> App.Do( Environment, 'JPEGOptimizer', {
> 'Format': App.Constants.JpegFormat.Standard,
> 'Compression': 20,
> 'FileName': u'',
> 'BackgroundColor': (255,255,255),
> 'ChromaSubSampling':
> App.Constants.ChromaSubSampling.YCC_1x1_1x1_1x1,
> 'SaveExifData': False,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Silent,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((10,0,0),1)
> }
> })
|
|
|
| | Copyright 2003 - 2009 forum4designers.com Software forum Computer Hardware reviews |
|