From: Willy on
Thanks JoeB. How is your script coming along??

W

"JoeB" <mymail(a)myserver.com> wrote in message
news:Xns98D3A18E5475JoeB(a)24.70.95.211...
> "willy" <willy(a)hotmail.com> wrote in
> news:QLydna3cqNFBhFPYnZ2dnUVZ_rSjnZ2d(a)adelphia.com:
>
>> I think something like this will work in v8
>> from JascApp import *
>> import os.path
>>
>> def ScriptProperties():
>> return {
>> 'Author': u'',
>> 'Copyright': u'',
>> 'Description': u'',
>> 'Host': u'Paint Shop Pro',
>> 'Host Version': u''
>> }
>>
>> def Do(Environment):
>>
>> False = App.Constants.Boolean.false
>> True = App.Constants.Boolean.true
>>
>> ImageInfo = App.Do( Environment, 'ReturnImageInfo' )
>>
>> FileName, file_type = os.path.splitext( ImageInfo['FileName'] )
>> #
>> splits out file type.
>>
>> # PNG Optimizer
>> App.Do( Environment, 'PNGOptimizer', {
>> 'TypeOfTransparency':
>> App.Constants.TransparencyType.NoTransparency,
>> 'Tolerance': 1,
>> 'BoostAmount': 1,
>> 'IncludeWindowsColors': False,
>> 'TypeOfImage': App.Constants.ImageType.TrueColor,
>> 'DitherPercent': 0,
>> 'PaletteType':
>> App.Constants.ColorSelection.OptimizedOctreePalette,
>> 'FileSubFormat': App.Constants.SubFormat.NonInterlaced,
>> 'BoostSelectedColors': False,
>> 'TransparentArea': App.Constants.Transparency.None,
>> 'FileName': FileName+'.png',
>> 'GeneralSettings': {
>> 'ExecutionMode':
> App.Constants.ExecutionMode.Default,
>> 'AutoActionMode':
> App.Constants.AutoActionMode.Match,
>> }
>> })
>>
>> Batch process use the script save option in batch process. Silent
>> checked.
>>
>
> I tested it in v.8.01 and it works fine, Willy.
>
> Regards,
>
> JoeB


From: JoeB on
"Willy" <willy(a)hotmail.com> wrote in
news:b_ydnaXjjLNIz1PYnZ2dnUVZ_r6vnZ2d(a)adelphia.com:

> Thanks JoeB. How is your script coming along??
>
> W
>

My script wasn't really needed by anybody, but I was working on the
concept of creating a script that followed the steps of a tutorial
(kind of like a Quick Guide idea but doing it with a script). Many
tutorials, as you would know, have the user start with a blank image
and then do things like draw shapes, set fill colors, duplicate
layers, manipulate a layer (maybe deform, or add an effect that
requires specific settings) and have various steps which need to be
completed to achieve the desired effect. Many people (I'm one of
them) never remember all of the steps when wishing to re-create a
similar image or final output effect.

So I was just experimenting with one of Lori's tutorials to see if
the whole thing could be scripted so that the various tools, effect
dialogues, etc., would be automatically selected by the script. I
found out, with your help and input from Suz, that it can be done.
However, being a tutorial and requiring specific user input for some
of the dialogues that open, there have to be message boxes,
preferably with the info also printed in the SOP, so that a user
knows what dialgue will be opening at a particularl stage, and what
their options are in choosing the inputs for that dialogue, to
achieve the desired result.

So if a person records a script following a tutorial for, as an
example, creating a 3D box effect to a given drawn shape or perhaps
selection from a raster image, deforming to taste, adding drop
shadow, and etc., the script can have a name like 3D Box Effect and
will run all of the needed tools and effects but let the user input
specific info depending on the size of the image, background color
they might want, etc.

Given that Quick Guides seem to have been removed from the latest
versions of PSP, this is as close to automating the process as I
could come up with, so I thought I'd experiment with it. Again, a
good learning process :-)

Thanks for your input that helped me along!

Regards,

JoeB
From: Marok on
> from JascApp import *

> import os.path
>
> def ScriptProperties():
> return {
> 'Author': u'',
> 'Copyright': u'',
> 'Description': u'',
> 'Host': u'Paint Shop Pro',
> 'Host Version': u''
> }
>
> def Do(Environment):
>
> False = App.Constants.Boolean.false
> True = App.Constants.Boolean.true
>
> ImageInfo = App.Do( Environment, 'ReturnImageInfo' )
>
> FileName, file_type = os.path.splitext( ImageInfo['FileName'] ) #
> splits out file type.
>
> # PNG Optimizer
> App.Do( Environment, 'PNGOptimizer', {
> 'TypeOfTransparency':
> App.Constants.TransparencyType.NoTransparency,
> 'Tolerance': 1,
> 'BoostAmount': 1,
> 'IncludeWindowsColors': False,
> 'TypeOfImage': App.Constants.ImageType.TrueColor,
> 'DitherPercent': 0,
> 'PaletteType':
> App.Constants.ColorSelection.OptimizedOctreePalette,
> 'FileSubFormat': App.Constants.SubFormat.NonInterlaced,
> 'BoostSelectedColors': False,
> 'TransparentArea': App.Constants.Transparency.None,
> 'FileName': FileName+'.png',
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> }
> })


PERFECT! :)
It works fine!!!
Thank you! :)

MaRoK