I'm an amateur photographer, and I'd like to use a script in PSP9 to automatically add an identical copyright to each of my images when working on them for web display.
I had adapted a script I've previously received to add my own text, and also ensure it is 50% opacity, but I don't know how to position the text to the center of the canvas, within the same script.
The current script is like this:
from JascApp import *
import JascUtils
def ScriptProperties():
return {
'Author': u'Charlotte Dolby',
'Copyright': u'© www.equinefocus.co.uk',
'Description': u'www.equinefocus.co.uk',
'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)
}
})
# ----------
# INIT
if JascUtils.RequireADoc( Environment ) == False: return
if not JascUtils.IsTrueColor(Environment, App.TargetDocument):
# IncreaseColorsTo16Million
App.Do( Environment, 'IncreaseColorsTo16Million', {
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Silent,
'AutoActionMode': App.Constants.AutoActionMode.Match,
'Version': ((9,0,1),1)
}
})
# INIT
# ----------
# ----------
# DIALOG BOXES
Result = App.Do( Environment, 'GetNumber', {
'DefaultValue': 2,
'MinValue': 1,
'MaxValue': 3,
'DialogTitle': 'Select Copyright Position',
'Prompt': '1) Left 2) Center 3) Right',
'GetInteger': True,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Interactive
}
})
if Result[ 'OKButton' ] == 0: raise SystemExit # Cancel Button
if Result[ 'EnteredNumber' ] == 1:
myposition = 10
myjustify = App.Constants.Justify.Left
elif Result[ 'EnteredNumber' ] == 2:
myposition = (App.ActiveDocument.Width +1) /2
myjustify = App.Constants.Justify.Center
elif Result[ 'EnteredNumber' ] == 3:
myposition = App.ActiveDocument.Width-10
myjustify = App.Constants.Justify.Right
# ----------
Result2 = App.Do( Environment, 'GetString', {
'DefaultText': '© www.equinefocus.co.uk',
'DialogTitle': 'Copyright Text',
'Prompt': 'Enter Text',
'MaxLength': 25,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Interactive
}
})
mytext = Result2[ 'EnteredText' ]
# ----------
Result3 = App.Do( Environment, 'GetNumber', {
'DefaultValue': 16,
'MinValue': 10,
'MaxValue': 250,
'DialogTitle': 'Copyright Text',
'Prompt': 'Font Size',
'GetInteger': True,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Interactive
}
})
myfont = Result3[ 'EnteredNumber' ]
# DIALOG BOXES
# ----------
# Text
App.Do( Environment, 'TextEx', {
'Visibility': True,
'CreateAs': App.Constants.CreateAs.Floating,
'Start': (myposition, App.ActiveDocument.Height-(myfont)/2),
'TextFlow': App.Constants.TextFlow.HorizontalDown,
'TextType': App.Constants.TextType.TextBase,
'Matrix': [
1,
0,
0,
0,
1,
0,
0,
0,
1
],
'AutoKern': True,
'Kerning': 0,
'Tracking': 0,
'Leading': 0,
'Font': u'Arial',
'PointSize': myfont,
'Italic': False,
'Bold': False,
'Underline': False,
'Strikethru': False,
'AntialiasStyle': App.Constants.AntialiasEx.Sharp,
'WarpText': True,
'SetText': myjustify,
'Fill': None,
'Stroke': None,
'LineWidth': 0,
'LineStyle': {
'Name': u'',
'FirstCap': (u'',0.25,0.25),
'LastCap': (u'',0.25,0.25),
'FirstSegCap': (u'',0.25,0.25),
'LastSegCap': (u'',0.25,0.25),
'UseSegmentCaps': False,
'Segments': []
},
'Join': App.Constants.JointStyle.Miter,
'MiterLimit': 10,
'Characters': mytext,
'Strings': None,
'TextTarget': (0,0,[1],False),
'PathTarget': None,
'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)
}
})
Any thoughts? Many thanks in advance, Charlie.