Copy link to clipboard
I can create the equivilant of Edit > Efine Pattern with
var id8139 = charIDToTypeID( "Mk " );
var desc849 = new ActionDescriptor();
var id8140 = charIDToTypeID( "null" );
var ref387 = new ActionReference();
var id8141 = charIDToTypeID( "Ptrn" );
ref387.putClass( id8141 );
desc849.putReference( id8140, ref387 );
var id8142 = charIDToTypeID( "Usng" );
var ref388 = new ActionReference();
var id8143 = charIDToTypeID( "Prpr" );
var id8144 = charIDToTypeID( "fsel" );
ref388.putProperty( id8143, id8144 );
var id8145 = charIDToTypeID( "Dcmn" );
var id8146 = charIDToTypeID( "Ordn" );
var id8147 = charIDToTypeID( "Trgt" );
ref388.putEnumerated( id8145, id8146, id8147 );
desc849.putReference( id8142, ref388 );
var id8148 = charIDToTypeID( "Nm " );
desc849.putString( id8148, "my tile Name" );
executeAction( id8139, desc849, DialogModes.NO );
However, I'd like it to return it's unique ID at the same time.
Such as "31a540ce-1828-db45-a501-f6621ff79cdf"
Is this possible?
That was Define Pattern, not Efine Pattern! 😞
I have not exhausted the options mentioned here
but I suspect you might have to use a Script specifically for Pattern creation to be able to use one of the work-arounds to get the id.
What are you going to do with it, anyway?
I've got several scripts that create chessboard style tiles. I did have a script in mind where two such tiles were created, and therefore had to reference the first one after the second was created.
Plus I'm curious.
Nothing to say against challenging oneself and such but what do you need the individual patterns’ IDs for in a Script that creates several Patterns?