Here is one way. If you don't need to deal with single channels you can delete the lines that contain channel#. You could also make dealing with the data easier by skipping the comp object and doing something like levelsOptions.inBlack = getShortFromStream( data, 2 ); var ref = new ActionReference(); ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") ); var data = executeActionGet(ref).getList(charIDToTypeID("Adjs")).getObjectValue(0).getData( stringIDToTypeID( 'legacyContentData' ) ); var check = getShortFromStream( data, 0 ); if(check != 2 ) throwError;// if not 2 then something is wrong var levelsOptions = {}; levelsOptions.comp = {}; levelsOptions.channel1 = {}; levelsOptions.channel2 = {}; levelsOptions.channel3 = {}; levelsOptions.comp.inBlack = getShortFromStream( data, 2 ); levelsOptions.comp.inWhite = getShortFromStream( data, 4 ); levelsOptions.comp.outBlack = getShortFromStream( data, 6 ); levelsOptions.comp.outWhite = getShortFromStream( data, 8 ); levelsOptions.comp.gamma = getShortFromStream( data, 10 )/100; levelsOptions.channel1.inBlack = getShortFromStream( data, 12 ); levelsOptions.channel1.inWhite = getShortFromStream( data, 14 ); levelsOptions.channel1.outBlack = getShortFromStream( data, 16 ); levelsOptions.channel1.outWhite = getShortFromStream( data, 18 ); levelsOptions.channel1.gamma = getShortFromStream( data, 20 )/100; levelsOptions.channel2.inBlack = getShortFromStream( data, 22 ); levelsOptions.channel2.inWhite = getShortFromStream( data, 24 ); levelsOptions.channel2.outBlack = getShortFromStream( data, 26 ); levelsOptions.channel2.outWhite = getShortFromStream( data, 28 ); levelsOptions.channel2.gamma = getShortFromStream( data, 30 )/100; levelsOptions.channel3.inBlack = getShortFromStream( data, 32 ); levelsOptions.channel3.inWhite = getShortFromStream( data, 34 ); levelsOptions.channel3.outBlack = getShortFromStream( data, 36 ); levelsOptions.channel3.outWhite = getShortFromStream( data, 38 ); levelsOptions.channel3.gamma = getShortFromStream( data, 40 )/100; function getShortFromStream( stream, pointer ) { var hi, low; hi = stream.charCodeAt( pointer ) << 8 ; low = stream.charCodeAt( pointer + 1 ); return hi + low; };
... View more