Creating a new photoshop doc with Python, Part Two

Just a quick update on my previous post about adding a new document to photoshop with python.

It seems that Cs2 uses pixels as it's default assumed unit. Due to this, my script previously did not bother to define a unit type for the document and it all worked fine.

I am running some tests of the script on Cs5 and coming up with some unexpected results- namely really massive documents, which are no fun. This is because the document is being made in CM by default rather than pixels. 

To fix this, I added in this wee bit o'code:
psApp.Preferences.RulerUnits = 1

Which defines the ruler units as pixels. The lesson... assume nothing! If it needs it, define it.

No comments:

Post a Comment