Hi X,
The code below throws a general error on the executeAction line of the code in the saveAllPresets function. I may be doing something wrong but thought I would let you know.
Code: Select all//@show include
//@includepath "/c/Program Files/Adobe/xtools;/Developer/xtools"
//@include "xlib/stdlib.js"
//@include "xlib/PresetsManager.jsx"
var f = new File('~/desktop/sample.pat');
var mgr = new PresetsManager();
// I get an error with this line
mgr.saveAllPresets(PresetType.PATTERNS, f);
PS I did a CSV update so I should be current.
Having trouble with PresetsManager.jsx
Having trouble with PresetsManager.jsx
I think the problem is saveAllPresets when called with patterns uses 'PttR' when it needs to be 'Ptrn'. Same with resetPreset. I think that patterns need to be like brushes where id and classID match, that isCode: Select allPresetType.PATTERNS = new PresetType("Patterns", 'PttR', 'Ptrn');should beCode: Select allPresetType.PATTERNS = new PresetType("Patterns", 'Ptrn', 'Ptrn');
Having trouble with PresetsManager.jsx
I think the problem is more likely that I'm using the id instead of the classID. Line 202 should be
Code: Select all ref.putProperty(cTID('Prpr'), presetType.classID);
It's still may be failing, but now for a completely different reason. sourceforge.net is having cvs problems so it may be a bit before I can get this sorted out and checked in.
Code: Select all ref.putProperty(cTID('Prpr'), presetType.classID);
It's still may be failing, but now for a completely different reason. sourceforge.net is having cvs problems so it may be a bit before I can get this sorted out and checked in.
Having trouble with PresetsManager.jsx
xbytor wrote:I think the problem is more likely that I'm using the id instead of the classID. I tried that before I suggested the change to PresetType.PATTERNS. Although changing the function from using id to classID does fix patterns it breaks gradients and maybe others.
Having trouble with PresetsManager.jsx
Although changing the function from using id to classID does fix patterns it breaks gradients and maybe others.
OK. I'll check on this when I have more free time.
OK. I'll check on this when I have more free time.