Thanks for the full script which I installed first thing this morning. Haven't been able to spend much time working on it yet but on first run I saw this message in the Script Output:
Executing FileOpen
Executing FileClose
Executing FileClose
Executing FileClose
Executing FileClose
Executing RunScript
Executing EnableOptimizedScriptUndo
Traceback (most recent call last):
File "C:\Users\terry\My PSP8 Files\Scripts-Trusted\nameonImage.PspScript", line 22, in Do
Title = u'' + App.TargetDocument.Title.rsplit('.',1)[0]
AttributeError: 'str' object has no attribute 'rsplit'
(BTW, is that truncated on the right? I'm guessing 'in Do' should continue as 'in Document....'? But using the Copy tool does not get anything more than the above onto the clipboard.)
I haven't yet fathomed the meaning of line 22, much less understood what's apparently wrong with it.
In case it helps I've uploaded a screenshot of your script tiled alongside another that I've been using for years. Maybe some of the 'header' data needs adjusting?
https://www.dropbox.com/s/dap37yup5un9o ... .jpg?raw=1
Hope to get back on the case later this afternoon or evening.
Much appreciate your help and patience on this!
EDIT:
Pleased to report that before leaving it I did some googling with 'python attribute split' and tried replacing your 'rplit' by 'split' - with success! Text was placed, although no drop shadow, with this script output:
Traceback (most recent call last):
File "C:\Users\terry\My PSP8 Files\Scripts-Trusted\nameonImage-2.PspScript", line 88, in Do
App.Do( Environment, 'DropShadow', {
NameError: global name 'False' is not defined
I then recorded script while adding drop shadow to the pre-selected text. That gave this:
Code: Select all
from JascApp import *
def ScriptProperties():
return {
'Author': u'',
'Copyright': u'',
'Description': u'',
'Host': u'Paint Shop Pro',
'Host Version': u'8.10'
}
def Do(Environment):
# EnableOptimizedScriptUndo
App.Do( Environment, 'EnableOptimizedScriptUndo', {
})
# Drop Shadow
App.Do( Environment, 'DropShadow', {
'Blur': 2,
'Color': (0,0,0),
'Horizontal': 12,
'NewLayer': App.Constants.Boolean.false,
'Opacity': 100,
'Vertical': 12,
'GeneralSettings': {
'ExecutionMode': App.Constants.ExecutionMode.Default,
'AutoActionMode': App.Constants.AutoActionMode.Match
}
})
So I replaced your line
by
Code: Select all
'NewLayer': App.Constants.Boolean.false,
... and it worked.
Thanks a bunch, that's going to save me a lot of work!
