The History brush scripts looks like this:
Code: Select all
function test() {
// Use
function step1(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putClass(cTID('ABTl'));
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;
};
Code: Select all
desc1.putData(sTID("toolRecordingData"), _hexToBin( "0000000602000000010000001632305441............"));
executeAction(sTID('toolRecording'), desc1, dialogMode);