Set Text Color (or any SolidColor) in PhotoshopCC via engine

I cant seem to change the TextItem color when I am adding Text to a Layer.

Here is a Shotgun Python Console snippet that makes a TextItem artLayer…

text_layer1 = = “Test Layer”
text_layer1.kind = engine.adobe.LayerKind.TEXT
text_layer1.textItem.kind = engine.adobe.TextType.PARAGRAPHTEXT
text_layer1.textItem.contents = “Test Text”

But adding what should set the TextColor according to…

text_color = engine.adobe.SolidColor() = 255 = 255 = 255
text_layer1 = = “Test Layer”
text_layer1.kind = engine.adobe.LayerKind.TEXT
text_layer1.textItem.kind = engine.adobe.TextType.PARAGRAPHTEXT
text_layer1.textItem.color = text_color
text_layer1.textItem.contents = “Test Text”

Causes errors on the ‘text_layer1.textItem.color = text_color’ line…

Traceback (most recent call last):
File “/Volumes/Droid/GREM/Production/Shotgun/PipelineConfigurations/Toolkit/install/app_store/tk-multi-pythonconsole/v1.1.2/python/app/”, line 190, in execute
exec(python_code, globals(), self._locals)
File “python input”, line 9, in
File “/Volumes/Droid/GREM/Production/Shotgun/PipelineConfigurations/Toolkit/install/app_store/tk-framework-adobe/v1.0.4/python/tk_framework_adobe/rpc/”, line 281, in setattr
self._communicator.rpc_set(self, name, value)
File “/Volumes/Droid/GREM/Production/Shotgun/PipelineConfigurations/Toolkit/install/app_store/tk-framework-adobe/v1.0.4/python/tk_framework_adobe/rpc/”, line 487, in rpc_set
AttributeError: Unable to set property color to value on object



Hi there!

This is a weird one, but I have a workaround for you that will work. The short answer is that it also fails when running the equivalent of your Python code directly from ExtendScript/Javascript, even though I agree with you that Adobe’s docs imply it should work. In addition to that, what I could get to work using JS directly behaves strangely when run through our Python RPC API. I’m not sure what’s going on there, but the gist of it is that each time the layer.textItem.color.rgb property is referenced, a different object instance is being returned. I’m guessing it has something to do with the fact that we detach and cache the object under the hood and refer back to it later, but I’ve not seen this particular behavior elsewhere in the ExtendScript API.

The workaround is the following:

adobe = engine.adobe
ll =
ll.kind = adobe.LayerKind.TEXT
ll.textItem.kind = adobe.TextType.PARAGRAPHTEXT
ll.textItem.contents = "test"
# Since you just created the layer, it will be the active layer.
# Call into it directly via javascript using rpc_eval and you'll
# be able to set red, green, and blue on the RGBColor object
# that's already assigned to textItem.color.rgb.
adobe.rpc_eval(' = 255')

It’s not as pretty as doing it all in Python syntax, but hopefully it’ll get the job done for you.



I have seen a lot of weird behavior when trying to replicate JS ExtendScript stuff, particularly in Premiere. Seems like a lot of times I always have to call things from the root rather than re-use a handle. Always starting with ‘app.’.

I have also had instances where I could use something like…


but not…

I have a couple of other dead-end issues that I will try with the rpc_eval() method.



It’s worth a shot in other places, yeah. I was hoping I could figure it out quickly and at least tell you we’d have a fix in sometime soon, but I’m a bit stumped at the moment. That being said, I’ll think about it some more, and since I’ll likely be in that code again within the next few weeks I might take a second crack at debugging it then.


So. This worked.

But, what I am really excited about is that this also helped to solve an issue with my Premiere Engine!

Here is what works in ExtendScript…

var path = “/Volumes/Production/post/jobs/GREM/250/source/Storyboard/SB_V01_20190326/”;
var results = app.project.importFiles([path]);

Here is what I have been trying in the Python Console…

app =
path = “/Volumes/Production/post/jobs/GREM/250/source/Storyboard/SB_V01_20190326/”
results = app.project.importFiles([path])

But it appears that the command is getting garbled in the conversion from Python to JS and fails.

Here is what works using rpc_eval()…

results = engine.adobe.rpc_eval(‘app.project.importFiles(["/Volumes/Production/post/jobs/GREM/250/source/Storyboard/SB_V01_20190326/"])’)


import_paths = ‘"%s"’ % ‘","’.join(paths)
results = engine.adobe.rpc_eval(‘app.project.importFiles([’+import_paths+’])’)

I have a couple other issues I hope this will solve.

Very pleased to have this new ‘God’ tool.