set frb to {{"Unterlegerweiss", {100.0, 0.0, 0.0}}, {"PANTONE 2395 C Magenta", {44.20539855957, 56.194499969482, -20.031099319458}}, {"PANTONE 7514 C Beige", {71.15739440918, 15.252899169922, 21.455200195312}}, {"PANTONE 7682 C Blau", {54.640998840332, -3.07389998436, -31.525299072266}}, {"Highlight Weiss", {100.0, 0.0, 0.0}}, {"sisBlack", {0.192299991846, -0.490299999714, -0.490299999714}}}
property xmlTextFront : "<?xml version=\"1.0\" standalone=\"yes\"?>
<SPOT_LOOKUP>
"
property xmlTextBack : "</SPOT_LOOKUP>"
property xml1 : "<SPOT name=\""
property xml2 : "\" SHORTNAME=\"KITDTFPR\" nColor=\"CMYKGBROW Process\" "
property f1 : "f1=\""
property f2 : "\" f2=\""
property f3 : "\" f3=\""
property f4 : "\" f4=\""
property f5 : "\" f5=\""
property f6 : "\" f6=\""
property f7 : "\" f7=\""
property f8 : "\" f8=\""
property f9 : "\" f9=\"100\""
property ende : "/>"
tell application "Adobe Photoshop 2024"
close every document saving no
set oRul to ruler units of settings
set ruler units of settings to pixel units
set xmlText to ""
repeat with einFrb in frb
set fName to item 1 of einFrb
set background color to {class:Lab color, value_L:item 1 of item 2 of einFrb, value_a:item 2 of item 2 of einFrb, value_b:item 3 of item 2 of einFrb}
make new document with properties {initial fill:use background color, height:10, width:10, mode:Lab}
tell current document
set hisSt to current history state
convert to profile "kit8c New.icm" intent absolute colorimetric without dithering and blackpoint compensation
--do action act from actSet
--my convMultich()
--my conv8c()
set liste to {}
repeat with einKanal in channels
set hsA to histogram of einKanal
set hs to item 1 of hsA
repeat with einHis from 1 to count hs
if item einHis of hs > 49 then
set chk to (round (100 - einHis / 2.56) * 100) / 100
set liste to liste & {chk as string}
exit repeat
end if
end repeat
end repeat
set xmlText to xmlText & xml1 & fName & xml2 & f1 & item 1 of liste & f2 & item 2 of liste & f3 & item 3 of liste & f4 & item 4 of liste & f5 & item 5 of liste & f6 & item 6 of liste & f7 & item 7 of liste & f8 & item 8 of liste & f9 & ende & "
"
set current history state to hisSt
close saving no
end tell
end repeat
set ruler units of settings to oRul
end tell
set xmlText to xmlTextFront & xmlText & xmlTextBack
set xmlText to xmlTextFront & xmlText & xmlTextBack
on conv8c()
tell application "Adobe Photoshop 2025"
tell current document
do javascript ("var idconvertToProfile = stringIDToTypeID( \"convertToProfile\" );
var desc241 = new ActionDescriptor();
var idnull = stringIDToTypeID( \"null\" );
var ref3 = new ActionReference();
var iddocument = stringIDToTypeID( \"document\" );
var idordinal = stringIDToTypeID( \"ordinal\" );
var idtargetEnum = stringIDToTypeID( \"targetEnum\" );
ref3.putEnumerated( iddocument, idordinal, idtargetEnum );
desc241.putReference( idnull, ref3 );
var idto = stringIDToTypeID( \"to\" );
desc241.putString( idto, \"\"\"kit8c New.icm\"\"\" );
var idintent = stringIDToTypeID( \"intent\" );
var idintent = stringIDToTypeID( \"intent\" );
var idcolorimetric = stringIDToTypeID( \"colorimetric\" );
desc241.putEnumerated( idintent, idintent, idcolorimetric );
var idmapBlack = stringIDToTypeID( \"mapBlack\" );
desc241.putBoolean( idmapBlack, true );
var iddither = stringIDToTypeID( \"dither\" );
desc241.putBoolean( iddither, false );
var idflatten = stringIDToTypeID( \"flatten\" );
desc241.putBoolean( idflatten, false );
var idrasterizePlaced = stringIDToTypeID( \"rasterizePlaced\" );
desc241.putBoolean( idrasterizePlaced, false );
var idshadowMode = stringIDToTypeID( \"shadowMode\" );
desc241.putInteger( idshadowMode, 5 );
executeAction( idconvertToProfile, desc241, DialogModes.NO );")
end tell
end tell
end conv8c
on convMultich()
tell application "Adobe Photoshop 2025"
tell current document
do javascript ("var idconvertToProfile = stringIDToTypeID( \"convertToProfile\" );
var desc230 = new ActionDescriptor();
var idnull = stringIDToTypeID( \"null\" );
var ref1 = new ActionReference();
var iddocument = stringIDToTypeID( \"document\" );
var idordinal = stringIDToTypeID( \"ordinal\" );
var idtargetEnum = stringIDToTypeID( \"targetEnum\" );
ref1.putEnumerated( iddocument, idordinal, idtargetEnum );
desc230.putReference( idnull, ref1 );
var idtoMode = stringIDToTypeID( \"toMode\" );
var idmultichannelMode = stringIDToTypeID( \"multichannelMode\" );
desc230.putClass( idtoMode, idmultichannelMode );
var idintent = stringIDToTypeID( \"intent\" );
var idintent = stringIDToTypeID( \"intent\" );
var idcolorimetric = stringIDToTypeID( \"colorimetric\" );
desc230.putEnumerated( idintent, idintent, idcolorimetric );
var idmapBlack = stringIDToTypeID( \"mapBlack\" );
desc230.putBoolean( idmapBlack, true );
var iddither = stringIDToTypeID( \"dither\" );
desc230.putBoolean( iddither, false );
var idflatten = stringIDToTypeID( \"flatten\" );
desc230.putBoolean( idflatten, false );
var idrasterizePlaced = stringIDToTypeID( \"rasterizePlaced\" );
desc230.putBoolean( idrasterizePlaced, false );
var idshadowMode = stringIDToTypeID( \"shadowMode\" );
desc230.putInteger( idshadowMode, 5 );
executeAction( idconvertToProfile, desc230, DialogModes.NO );")
end tell
end tell
end convMultich