Copy link to clipboard
Copied
I would like to make an auto-updater function to reload pattern files when they are updated.
I already have everything working.. reading pattern files, saving the dates, loading patterns, ect...
Only thing I'm still missing is a script that can remove groups.
I can only replace all patterns by loading the first pattern file with "append" false, and the rest as true.
This way, the first load will remove all patterns.
But is there a way to remove only 1 group, so I can load individual pattern files instead of reloading all pattern files for every update on a single pattern file?
Script listener gave me a Dlt event, but nothing that refers to a pattern group name...
var idDlt = charIDToTypeID( "Dlt " );
var desc68 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref6 = new ActionReference();
var idPtrn = charIDToTypeID( "Ptrn" );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref6.putEnumerated( idPtrn, idOrdn, idTrgt );
desc68.putReference( idnull, ref6 );
executeAction( idDlt, desc68, DialogModes.NO );
s2t = stringIDToTypeID;
(r = new ActionReference()).putName(s2t('pattern'), 'pattern group name');
(d = new ActionDescriptor()).putReference(s2t('target'), r);
executeAction(s2t('delete'), d, DialogModes.NO);
Copy link to clipboard
Copied
s2t = stringIDToTypeID;
(r = new ActionReference()).putName(s2t('pattern'), 'pattern group name');
(d = new ActionDescriptor()).putReference(s2t('target'), r);
executeAction(s2t('delete'), d, DialogModes.NO);
Copy link to clipboard
Copied
Works great, Thanks!!!
How do you create these kinds of action manager scripts?
I know how to use scriptlistener, and I manage to make nice functions from those, but for these kind of scripts, scriptlistener is useless. What documentation can you advice me to learn more about this?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
The official documentation boils down to a short description of the AM function methods in Adobe Photoshop CC JavaScript Reference and a couple of pages in Adobe Photoshop CS6 Scripting Guide
Everything else is proposed to be studied independently.
All I know - I know thanks to the users of this community and ps-scripts.com