Get pattern ID at creation time

Explorer ,
Mar 30, 2022 Mar 30, 2022

Copy link to clipboard

Copied

I can create the equivilant of Edit > Efine Pattern with 

function define_pattern()
{
    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?

TOPICS
Actions and scripting

Views

77

Likes

Translate

Translate

Report

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
Explorer ,
Mar 30, 2022 Mar 30, 2022

Copy link to clipboard

Copied

That was Define Pattern, not Efine Pattern! 😞

 

 

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Apr 01, 2022 Apr 01, 2022

Copy link to clipboard

Copied

I have not exhausted the options mentioned here 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/get-pattern-id/td-p/10376973

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? 

Likes

Translate

Translate

Report

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
Explorer ,
Apr 06, 2022 Apr 06, 2022

Copy link to clipboard

Copied

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.

 

 

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Apr 06, 2022 Apr 06, 2022

Copy link to clipboard

Copied

LATEST

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? 

Likes

Translate

Translate

Report

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