How load .cube-files via ExtendScript?

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Kukurykus, Tom, xbytor

Dimatokis
Posts: 11
Joined: Wed Aug 17, 2016 7:50 pm

How load .cube-files via ExtendScript?

Post by Dimatokis »

I tried to grab the action with ScriptenListener, it turned out this

Code: Select all

// =======================================================
var idMk = charIDToTypeID( "Mk " );
var desc60 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref24 = new ActionReference();
var idAdjL = charIDToTypeID( "AdjL" );
ref24.putClass( idAdjL );
desc60.putReference( idnull, ref24 );
var idUsng = charIDToTypeID( "Usng" );
var desc61 = new ActionDescriptor();
var idType = charIDToTypeID( "Type" );
var idcolorLookup = stringIDToTypeID( "colorLookup" );
desc61.putClass( idType, idcolorLookup );
var idAdjL = charIDToTypeID( "AdjL" );
desc60.putObject( idUsng, idAdjL, desc61 );
executeAction( idMk, desc60, DialogModes.NO );

// =======================================================
var idsetd = charIDToTypeID( "setd" );
var desc62 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref25 = new ActionReference();
var idAdjL = charIDToTypeID( "AdjL" );
var idOrdn = charIDToTypeID( "Ordn" );
var idTrgt = charIDToTypeID( "Trgt" );
ref25.putEnumerated( idAdjL, idOrdn, idTrgt );
desc62.putReference( idnull, ref25 );
var idT = charIDToTypeID( "T " );
var desc63 = new ActionDescriptor();
var idlookupType = stringIDToTypeID( "lookupType" );
var idcolorLookupType = stringIDToTypeID( "colorLookupType" );
var idthreeDLUT = stringIDToTypeID( "3DLUT" );
desc63.putEnumerated( idlookupType, idcolorLookupType, idthreeDLUT );
var idNm = charIDToTypeID( "Nm " );
desc63.putString( idNm, """My Name""" ); // displayed name
var idprofile = stringIDToTypeID( "profile" );
desc63.putData( idprofile, String.fromCharCode( 0, 0, 14, 228, 65, 68, 66, 69, 4, 0, ..........)) // long data

var idcolorLookup = stringIDToTypeID( "colorLookup" );
desc62.putObject( idT, idcolorLookup, desc63 );
executeAction( idsetd, desc62, DialogModes.NO );
In the code there is an incomprehensible data format obtained from my .cube file
How to achieve the same data format from my .cube-file?

User avatar
txuku
Posts: 117
Joined: Thu Jan 01, 1970 12:00 am

Re: How load .cube-files via ExtendScript?

Post by txuku »

Bonjour

What exactly is this .cube-file???? :)

Dimatokis
Posts: 11
Joined: Wed Aug 17, 2016 7:50 pm

Re: How load .cube-files via ExtendScript?

Post by Dimatokis »

This is a color lookup table. Used in the Photoshop "Lookup Color" Adjustment layer
https://en.wikipedia.org/wiki/3D_lookup_table

User avatar
txuku
Posts: 117
Joined: Thu Jan 01, 1970 12:00 am

Re: How load .cube-files via ExtendScript?

Post by txuku »

OK !

Thank you :)

wasfiwasfi
Posts: 45
Joined: Fri Nov 04, 2016 8:29 am

Re: How load .cube-files via ExtendScript?

Post by wasfiwasfi »

check this please !
i think it might help:
https://forums.adobe.com/thread/2155292

Dimatokis
Posts: 11
Joined: Wed Aug 17, 2016 7:50 pm

Re: How load .cube-files via ExtendScript?

Post by Dimatokis »

Thank you. But in that thread there is no solution for the same reason

dkyeah
Posts: 1
Joined: Tue Jul 23, 2019 11:53 am

Re: How load .cube-files via ExtendScript?

Post by dkyeah »

Did you ever manage to find a solution to loading a cube or any other lut file using ExtendScript?