|
split in Python
I can get the fullpath filename into a variable
CurDoc=App.ActiveDocument.Name
when I print I see "F:\dir1\dir2\dir3\dir5\filename.ext"
I need to get just 'filename.ext' into a variable. So I try:
NewFileName=CurDoc.split("\")[5]
or if it isn't zero-based I can put 6, but that's not the issue right now ...
I'm doing this within the Paint Shop Pro pspscripting environment which uses Python.
Every time I try to run this I get the error:
Executing RunScript
File "<string>", line 49
NewFileName=CurDoc.split("\")[5]
^
SyntaxError: invalid token
and that ^ is actually pointing at the period between CurDoc and split.
Any PSP scripters or Python users?
Thanks!
|