Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Deleting Patters using scripting

Participant ,
Oct 31, 2021 Oct 31, 2021

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 );
TOPICS
Actions and scripting
505
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Oct 31, 2021 Oct 31, 2021

 

s2t = stringIDToTypeID;
(r = new ActionReference()).putName(s2t('pattern'), 'pattern group name');
(d = new ActionDescriptor()).putReference(s2t('target'), r);
executeAction(s2t('delete'), d, DialogModes.NO);

 

 

Translate
Adobe
Guide ,
Oct 31, 2021 Oct 31, 2021

 

s2t = stringIDToTypeID;
(r = new ActionReference()).putName(s2t('pattern'), 'pattern group name');
(d = new ActionDescriptor()).putReference(s2t('target'), r);
executeAction(s2t('delete'), d, DialogModes.NO);

 

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 02, 2021 Nov 02, 2021

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 02, 2021 Nov 02, 2021
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Nov 02, 2021 Nov 02, 2021
LATEST

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 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines