This is the test script and it works
Code: Select all
from PSPApp import *
def ScriptProperties():
return {
'Author': u'',
'Copyright': u'',
'Description': u'',
'Host': u'PaintShop Pro',
'Host Version': u'25.00'
}
def Do(Environment):
# EnableOptimizedScriptUndo
App.Do( Environment, 'EnableOptimizedScriptUndo', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((25,0,0),1)
}
})
# RotateClockWise
App.Do( Environment, 'RotateClockWise', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((25,0,0),1)
}
})The guide says the following:
PaintShop Pro maintains a collection of all the open documents, called App.Documents. This is a Python list object, and can be iterated like any list. To do something to all open documents is as simple as:
for Doc in App.Documents:
App.Do( Environment, 'Flip', {}, Doc )
This makes use of the fact that the fourth parameter to App.Do is the target document to use for the command.
So I change it to the following:for Doc in App.Documents:
App.Do( Environment, 'Flip', {}, Doc )
This makes use of the fact that the fourth parameter to App.Do is the target document to use for the command.
Code: Select all
from PSPApp import *
def ScriptProperties():
return {
'Author': u'',
'Copyright': u'',
'Description': u'',
'Host': u'PaintShop Pro',
'Host Version': u'25.00'
}
def Do(Environment):
# EnableOptimizedScriptUndo
App.Do( Environment, 'EnableOptimizedScriptUndo', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((25,0,0),1)
}
})
# RotateClockWise
for Doc in App.Documents:
App.Do( Environment, 'RotateClockWise', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((25,0,0),1)
}, Doc )Executing RunScript
File "<string>", line 29
}, Doc )
^
SyntaxError: invalid syntax
Any Suggestions?
Thank You
