This is Interesting: Free Magazines for Graphics designers and webmasters
Home > Archive > PainShop Pro Scripting > May 2007 > PSP 9 Scripts not working in Batch Process.
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 |
PSP 9 Scripts not working in Batch Process.
|
|
| Corel PSP 2007-05-13, 10:17 pm |
| Hello all.
My first time here. Not sure how to search or see if there is an answer
here.
Too many to read them all!
I'll try to describe. Sorry for including all the stuff.
I don't know the rules here. If this is not the correct way, please someone
correct me. Thanks.
Issue ...
I have a simple script.
Add small black border, save alpha channel, add larger white border, select
none, load alpha channel, do a drop shadow, resize the photo.
I have recorded the script in PSP9. It works manually when I run the script
against an open photo.
But when I run the script in Batch Process against a group of photos, I run
into problems.
When it runs the Load Alpha Channel step, it craps out with the message ...
.... the requested alpha channel layer could not be found.
I have preferences File Locations set up pointing my PSPScripts.
This used to work in PSP8, so there must be some differences between PSP8
and 9 with scripts.
I have tried a number of things and tried to find a sample on the web, but
nothing yet.
If anyone has a solution or knows where I can find a solution, please let me
know.
Thanks in advance ...
Bob
Here is the script output ...
(Note: I do not have a DeleteLayer command in my Script. Not sure where
that is coming from.)
Executing RunScript
Executing EnableOptimizedScriptUndo
Executing SelectAll
Executing AddBorders
Executing SelectSaveAlpha
Executing AddBorders
Executing SelectNone
Executing DeleteLayer
Executing SelectLoadAlpha
------- Command Execution Failed -----------
Command Name: SelectLoadAlpha
Error Text: The requested alpha channel layer could not be found.
Traceback (most recent call last):
File "C:\Documents and Settings\bserack\My Documents\My PSP
Files\Scripts-Trusted\600x800 Test 2.PspScript", line 87, in Do
App.Do( Environment, 'SelectLoadAlpha', {
RuntimeError: The requested alpha channel layer could not be found.
Script '600x800 Test 2' has completed with an error.
Here is the recorded script ...
from JascApp import *
def ScriptProperties():
return {
'Author': u'',
'Copyright': u'',
'Description': u'',
'Host': u'Paint Shop Pro 9',
'Host Version': u'9.01'
}
def Do(Environment):
# EnableOptimizedScriptUndo
App.Do( Environment, 'EnableOptimizedScriptUndo', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})
# SelectAll
App.Do( Environment, 'SelectAll', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})
# AddBorders
App.Do( Environment, 'AddBorders', {
'Bottom': 2,
'Left': 2,
'Right': 2,
'Symmetric': True,
'Top': 2,
'Color': (0,0,0),
'DimUnits': App.Constants.UnitsOfMeasure.Pixels,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})
# SelectSaveAlpha
App.Do( Environment, 'SelectSaveAlpha', {
'SourceImage': 0,
'AlphaName': u'Selection #1',
'Overwrite': False,
'UpperLeft': False,
'AlphaIndex': None,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})
# AddBorders
App.Do( Environment, 'AddBorders', {
'Bottom': 20,
'Left': 20,
'Right': 20,
'Symmetric': True,
'Top': 20,
'Color': (255,255,255),
'DimUnits': App.Constants.UnitsOfMeasure.Pixels,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})
# SelectNone
App.Do( Environment, 'SelectNone', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})
# SelectLoadAlpha
App.Do( Environment, 'SelectLoadAlpha', {
'SourceImage': 0,
'AlphaIndex': 0,
'AlphaName': None,
'SelectionOperation': App.Constants.SelectionOperation.Replace,
'UpperLeft': False,
'ClipToCanvas': False,
'Invert': False,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})
# Drop Shadow
App.Do( Environment, 'DropShadow', {
'Blur': 20,
'Color': (0,0,0),
'Horizontal': 8,
'NewLayer': False,
'Opacity': 40,
'Vertical': 8,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})
| |
| Spandex Rutabaga 2007-05-13, 10:17 pm |
| Corel PSP wrote:
>
> Hello all.
> My first time here. Not sure how to search
Your newsreader has a search function.
> or see if there is an answer
> here.
> Too many to read them all!
>
> I'll try to describe. Sorry for including all the stuff.
> I don't know the rules here. If this is not the correct way, please someone
> correct me. Thanks.
The rules are here: http://tinyurl.com/b5hxy
> Issue ...
> I have a simple script.
> Add small black border, save alpha channel, add larger white border, select
> none, load alpha channel, do a drop shadow, resize the photo.
Why don't you do it the following way to skip saving to the
alpha channel entirely?
1. Select All.
2. Add first border.
3. Add second border.
4. Promote selection to layer.
5. Select None.
6. Drop Shadow.
7. Resize. You can optionally flatten before resizing.
> I have recorded the script in PSP9. It works manually when I run the script
> against an open photo.
> But when I run the script in Batch Process against a group of photos, I run
> into problems.
> When it runs the Load Alpha Channel step, it craps out with the message ...
> ... the requested alpha channel layer could not be found.
Perhaps the requested alpha channel could not be found. The
script below expects an alpha channel with the name not set
to anything (i.e. AlphaName is specified as 'None' for the
SelectLoadAlpha command). However, you had to have named the
alpha channel as something when you saved it since you can't
enter an empty string at the Save prompt. I'm not sure if this
is the problem but you could try entering u'Selection #1' (the
name you used when saving) in place of the 'None'. There is
also something puzzling in your script output. The output
reports DeleteLayer after SelectNone and before SelectLoadAlpha
but the script you posted has no step that deletes a layer.
Are you sure you are running the script you think you are
running? If you have duplicate scripts with the same name in
different folders PSP will run the first one it finds, ignoring
any others, and it won't tell it's doing that except for the
first time this happens for that particular script. Look very
carefully to make sure something like that isn't messing you
up.
> I have preferences File Locations set up pointing my PSPScripts.
> This used to work in PSP8, so there must be some differences between PSP8
> and 9 with scripts.
Or there is some confusion at your end. It is hard to account
for the script output you posted with the script you also
posted.
> I have tried a number of things and tried to find a sample on the web, but
> nothing yet.
> If anyone has a solution or knows where I can find a solution, please let me
> know.
Rather than rooting about searching for the solution you could
just use my method, which makes no references to an alpha channel.
By the way, your script (and my steps) won't work if the original
image is a regular layer rather than a background layer. This is
because Add Borders works only on images comprising a background
layer and no other layers.
> Thanks in advance ...
> Bob
>
> Here is the script output ...
> (Note: I do not have a DeleteLayer command in my Script. Not sure where
> that is coming from.)
>
> Executing RunScript
> Executing EnableOptimizedScriptUndo
> Executing SelectAll
> Executing AddBorders
> Executing SelectSaveAlpha
> Executing AddBorders
> Executing SelectNone
> Executing DeleteLayer
> Executing SelectLoadAlpha
> ------- Command Execution Failed -----------
> Command Name: SelectLoadAlpha
> Error Text: The requested alpha channel layer could not be found.
> Traceback (most recent call last):
> File "C:\Documents and Settings\bserack\My Documents\My PSP
> Files\Scripts-Trusted\600x800 Test 2.PspScript", line 87, in Do
> App.Do( Environment, 'SelectLoadAlpha', {
> RuntimeError: The requested alpha channel layer could not be found.
> Script '600x800 Test 2' has completed with an error.
>
> Here is the recorded script ...
>
> from JascApp import *
>
> def ScriptProperties():
> return {
> 'Author': u'',
> 'Copyright': u'',
> 'Description': u'',
> 'Host': u'Paint Shop Pro 9',
> 'Host Version': u'9.01'
> }
>
> def Do(Environment):
> # EnableOptimizedScriptUndo
> App.Do( Environment, 'EnableOptimizedScriptUndo', {
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # SelectAll
> App.Do( Environment, 'SelectAll', {
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # AddBorders
> App.Do( Environment, 'AddBorders', {
> 'Bottom': 2,
> 'Left': 2,
> 'Right': 2,
> 'Symmetric': True,
> 'Top': 2,
> 'Color': (0,0,0),
> 'DimUnits': App.Constants.UnitsOfMeasure.Pixels,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # SelectSaveAlpha
> App.Do( Environment, 'SelectSaveAlpha', {
> 'SourceImage': 0,
> 'AlphaName': u'Selection #1',
> 'Overwrite': False,
> 'UpperLeft': False,
> 'AlphaIndex': None,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # AddBorders
> App.Do( Environment, 'AddBorders', {
> 'Bottom': 20,
> 'Left': 20,
> 'Right': 20,
> 'Symmetric': True,
> 'Top': 20,
> 'Color': (255,255,255),
> 'DimUnits': App.Constants.UnitsOfMeasure.Pixels,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # SelectNone
> App.Do( Environment, 'SelectNone', {
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # SelectLoadAlpha
> App.Do( Environment, 'SelectLoadAlpha', {
> 'SourceImage': 0,
> 'AlphaIndex': 0,
> 'AlphaName': None,
> 'SelectionOperation': App.Constants.SelectionOperation.Replace,
> 'UpperLeft': False,
> 'ClipToCanvas': False,
> 'Invert': False,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # Drop Shadow
> App.Do( Environment, 'DropShadow', {
> 'Blur': 20,
> 'Color': (0,0,0),
> 'Horizontal': 8,
> 'NewLayer': False,
> 'Opacity': 40,
> 'Vertical': 8,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
| |
| SkyFlyer 2007-05-13, 10:17 pm |
| Thanks for the answer.
You have given me some things to check out.
I knew about the delete. It is not in my script.
Having said that, that doesn't mean there isn't something out there with the
same name.
I don't understand why it would work manually, but not in batch process.
I had tried putting the same name (Alphaname) in the load alpha channel.
Didn't work.
I'll try some of your suggestions.
And look for duplicates or other issues.
You suggestion of a simpler script worked just fine.
So, I'll just go with it. And it worked in batch.
There still must be some issue with PSP 9, alpha channel, and batch process.
I recorded a new macro, named it something that is not on my computer.
It ran fine manually, but crapped out under batch process.
Don't know where the Delete Layer comes from, but is still there. It is NOT
in my script.
Also added the same name that was used in the save alpha.
No go. Life will go on!
I'll not waste any more of your time.
I'll just go with the simple script.
One more quick thing ...
I was reading in another thread about scripting and there was mention of ...
... the Scripting for Script Authors Manual.
Can anyone tell me what this is and where I can find it?
Is it on the Internet?
Thanks again for your help ...
Bob
"Spandex Rutabaga" <SpRu@agabatur.xednaps> wrote in message
news:4647A814.C1E98ADC@agabatur.xednaps...[color=darkred]
> Corel PSP wrote:
>
> Your newsreader has a search function.
>
>
> The rules are here: http://tinyurl.com/b5hxy
>
>
> Why don't you do it the following way to skip saving to the
> alpha channel entirely?
>
> 1. Select All.
> 2. Add first border.
> 3. Add second border.
> 4. Promote selection to layer.
> 5. Select None.
> 6. Drop Shadow.
> 7. Resize. You can optionally flatten before resizing.
>
>
> Perhaps the requested alpha channel could not be found. The
> script below expects an alpha channel with the name not set
> to anything (i.e. AlphaName is specified as 'None' for the
> SelectLoadAlpha command). However, you had to have named the
> alpha channel as something when you saved it since you can't
> enter an empty string at the Save prompt. I'm not sure if this
> is the problem but you could try entering u'Selection #1' (the
> name you used when saving) in place of the 'None'. There is
> also something puzzling in your script output. The output
> reports DeleteLayer after SelectNone and before SelectLoadAlpha
> but the script you posted has no step that deletes a layer.
> Are you sure you are running the script you think you are
> running? If you have duplicate scripts with the same name in
> different folders PSP will run the first one it finds, ignoring
> any others, and it won't tell it's doing that except for the
> first time this happens for that particular script. Look very
> carefully to make sure something like that isn't messing you
> up.
>
>
> Or there is some confusion at your end. It is hard to account
> for the script output you posted with the script you also
> posted.
>
>
> Rather than rooting about searching for the solution you could
> just use my method, which makes no references to an alpha channel.
> By the way, your script (and my steps) won't work if the original
> image is a regular layer rather than a background layer. This is
> because Add Borders works only on images comprising a background
> layer and no other layers.
>
| |
|
| "SkyFlyer" <bobserack@charter.net> wrote in news:46466025_1@cnews:
[snipped]
>
> One more quick thing ...
> I was reading in another thread about scripting and there was mention
> of ...
> ... the Scripting for Script Authors Manual.
>
> Can anyone tell me what this is and where I can find it?
> Is it on the Internet?
>
You can find it at this link, near the bottom of the page:
http://tinyurl.com/54pvo
Regards,
JoeB
[snipped]
| |
|
| Your script runs for me in v XI Batch mode. I have Stop on error, Use
script. and Silent Mode checked.
W
"Corel PSP" <bobserack@charter.net> wrote in message
news:464646f1$2_1@cnews...
> Hello all.
> My first time here. Not sure how to search or see if there is an answer
> here.
> Too many to read them all!
>
> I'll try to describe. Sorry for including all the stuff.
> I don't know the rules here. If this is not the correct way, please
> someone correct me. Thanks.
>
> Issue ...
> I have a simple script.
> Add small black border, save alpha channel, add larger white border,
> select none, load alpha channel, do a drop shadow, resize the photo.
> I have recorded the script in PSP9. It works manually when I run the
> script against an open photo.
> But when I run the script in Batch Process against a group of photos, I
> run into problems.
> When it runs the Load Alpha Channel step, it craps out with the message
> ...
> ... the requested alpha channel layer could not be found.
> I have preferences File Locations set up pointing my PSPScripts.
> This used to work in PSP8, so there must be some differences between PSP8
> and 9 with scripts.
> I have tried a number of things and tried to find a sample on the web, but
> nothing yet.
> If anyone has a solution or knows where I can find a solution, please let
> me know.
>
> Thanks in advance ...
> Bob
>
> Here is the script output ...
> (Note: I do not have a DeleteLayer command in my Script. Not sure where
> that is coming from.)
>
>
> Executing RunScript
> Executing EnableOptimizedScriptUndo
> Executing SelectAll
> Executing AddBorders
> Executing SelectSaveAlpha
> Executing AddBorders
> Executing SelectNone
> Executing DeleteLayer
> Executing SelectLoadAlpha
> ------- Command Execution Failed -----------
> Command Name: SelectLoadAlpha
> Error Text: The requested alpha channel layer could not be found.
> Traceback (most recent call last):
> File "C:\Documents and Settings\bserack\My Documents\My PSP
> Files\Scripts-Trusted\600x800 Test 2.PspScript", line 87, in Do
> App.Do( Environment, 'SelectLoadAlpha', {
> RuntimeError: The requested alpha channel layer could not be found.
> Script '600x800 Test 2' has completed with an error.
>
> Here is the recorded script ...
>
> from JascApp import *
>
> def ScriptProperties():
> return {
> 'Author': u'',
> 'Copyright': u'',
> 'Description': u'',
> 'Host': u'Paint Shop Pro 9',
> 'Host Version': u'9.01'
> }
>
> def Do(Environment):
> # EnableOptimizedScriptUndo
> App.Do( Environment, 'EnableOptimizedScriptUndo', {
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # SelectAll
> App.Do( Environment, 'SelectAll', {
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # AddBorders
> App.Do( Environment, 'AddBorders', {
> 'Bottom': 2,
> 'Left': 2,
> 'Right': 2,
> 'Symmetric': True,
> 'Top': 2,
> 'Color': (0,0,0),
> 'DimUnits': App.Constants.UnitsOfMeasure.Pixels,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # SelectSaveAlpha
> App.Do( Environment, 'SelectSaveAlpha', {
> 'SourceImage': 0,
> 'AlphaName': u'Selection #1',
> 'Overwrite': False,
> 'UpperLeft': False,
> 'AlphaIndex': None,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # AddBorders
> App.Do( Environment, 'AddBorders', {
> 'Bottom': 20,
> 'Left': 20,
> 'Right': 20,
> 'Symmetric': True,
> 'Top': 20,
> 'Color': (255,255,255),
> 'DimUnits': App.Constants.UnitsOfMeasure.Pixels,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # SelectNone
> App.Do( Environment, 'SelectNone', {
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # SelectLoadAlpha
> App.Do( Environment, 'SelectLoadAlpha', {
> 'SourceImage': 0,
> 'AlphaIndex': 0,
> 'AlphaName': None,
> 'SelectionOperation': App.Constants.SelectionOperation.Replace,
> 'UpperLeft': False,
> 'ClipToCanvas': False,
> 'Invert': False,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
> # Drop Shadow
> App.Do( Environment, 'DropShadow', {
> 'Blur': 20,
> 'Color': (0,0,0),
> 'Horizontal': 8,
> 'NewLayer': False,
> 'Opacity': 40,
> 'Vertical': 8,
> 'GeneralSettings': {
> 'ExecutionMode': App.Constants.ExecutionMode.Default,
> 'AutoActionMode': App.Constants.AutoActionMode.Match,
> 'Version': ((9,0,1),1)
> }
> })
>
| |
|
| Spandex Rutabaga wrote:
> Corel PSP wrote:
[color=darkred]
> Your newsreader has a search function.
I sent Bob here because I thought he might enjoy these groups over emailing
questions and answers. I found Bob is totally new to newsgroups, so I sent
him a clickable link for this group... all else will probably take a moment
to find out :-)
Joske
|
|
|
| | Copyright 2003 - 2009 forum4designers.com Software forum Computer Hardware reviews |
|