How create a route data for the Art History Brush?

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Kukurykus, Tom, xbytor

Posts: 2
Joined: Mon Sep 28, 2020 8:00 pm

How create a route data for the Art History Brush?

Post by meikatun »

I'm creating an action that uses the Art History Brush But the real problem it's the toolRecordingData because there it's where the brush route it's locate, this is a real issue for me because if I try to convert the action (.atn) to JSX the computer totally freeze and took 1 and a half day (I actually wait) just to create the data for an history brush that cover an area of 3,000px X 3,000px but the file it's massive, so I wonder if there's a way to calculate the Photo size and create a "Route" for the history brush.

The History brush scripts looks like this:

Code: Select all

function test() {
  // Use
  function step1(enabled, withDialog) {
    if (enabled != undefined && !enabled)
    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
    var desc1 = new ActionDescriptor();
    var ref1 = new ActionReference();
    desc1.putReference(cTID('null'), ref1);
var _hexToBin = 
function (h) {
  function binMap(n) {
    if (n.match(/[0-9]/)) return parseInt(n);
    return parseInt((n.charCodeAt(0) - 'A'.charCodeAt(0)) + 10);

  h = h.toUpperCase().replace(/\s/g, '');
  var bytes = '';

  for (var i = 0; i < h.length/2; i++) {
    var hi = h.charAt(i * 2);
    var lo = h.charAt(i * 2 + 1);
    var b = (binMap(hi) << 4) + binMap(lo);
    bytes += String.fromCharCode(b);
  return bytes;
Where the "route" data looks like:

Code: Select all

desc1.putData(sTID("toolRecordingData"), _hexToBin(  "0000000602000000010000001632305441............"));

executeAction(sTID('toolRecording'), desc1, dialogMode);