0 Replies Latest reply on May 8, 2018 8:58 AM by mikhail_b

    Access actions from a script

    mikhail_b

      Hi all,

       

      I'm trying to export shapes of the strokes drawn in Photoshop. Simply put, I want a user to draw the way they normally draw in Photoshop, then run some script/action and get a text file that contains all paths of the brush strokes they drew (with other parameters like brush type, color, etc.).

       

      Is it possible to do in Photoshop?

       

      What I've tried:

      1. I've found out that I can record the whole process as an Photoshop Action, if I enable "Allow Tool Recording". However, I don't understand how to access this action from a script (or to read the action file anyhow) so that to access the stroke shapes. In the Scripting API, there is description of PathItem and stuff of that sort, it's just I don't know how to extract those from an action.

      2. There is a Scripting Listener plugin that outputs a script reproducing the recorded action. However, this thing disables "Allow Tool Recording" automatically and I don't see a way around that.

      3. I've tried xtools by xbytor, but even for a simple single stroke action, their 'Action to XML' fails to produce the xml file (or maybe it's taking too long), and their codebase is so big that debugging it is scary.

       

      Any ideas will be much appreciated!