[GastForen Programmierung/Entwicklung AppleScript Photoshop Convert to Profile Dialog

  • Suche
  • Hilfe
  • Lesezeichen
  • Benutzerliste
Themen
Beiträge
Moderatoren
Letzter Beitrag

Photoshop Convert to Profile Dialog

jekyll
Beiträge gesamt: 2049

15. Dez 2024, 17:36
Beitrag # 1 von 2
Bewertung:
(37180 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
Hallo Allerseits,
ich versuche mit Photoshop Lab Werte ins 8 Farbwerte zu konvertieren.

Leider mag PS nicht ins Mehrkanal Profil ohne Dialog zu konvertieren.

In dem Dialog muss ich sogar die Mehrkanal Profil jedesmal neu wählen damit mein Skript korrekt durch läuft.

Hat jemand ne Idee wie ich in den Dialog mit mein Skript die Kanal neu auswählen kann und OK drücken kann.

Hier das Profil:
http://www.download.siscosep.com/kit8c.zip

Code
  1. 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

X

Photoshop Convert to Profile Dialog

jekyll
Beiträge gesamt: 2049

6. Jan 2025, 01:03
Beitrag # 2 von 2
Beitrag ID: #589264
Bewertung:
(35560 mal gelesen)
URL zum Beitrag
Beitrag als Lesezeichen
moin,
hier ist die Lösung:

Dieser code ins Script Debugger ausführen.
Code
  1. tell application "System Events"
    set apptemp to "Adobe Photoshop 2025"
    set frontmost of process apptemp to true
    tell front window of (first application process whose frontmost is true)
    set uiElems to entire contents
    end tell
    end tell


Danach in den Variable Fenster -> uiElems Variable öffnen -> dort Rechtscklick aufs Value von den gesuchten Element / item -> copy Value.

Code
  1. try
    with timeout of 0.3 seconds
    convert to profile "kit8c New.icm" intent absolute colorimetric without dithering and blackpoint compensation
    end timeout
    on error
    tell application "System Events"
    set apptemp to "Adobe Photoshop 2025"
    set frontmost of process apptemp to true
    tell its application process "Adobe Photoshop 2025"
    tell its window "In Profil umwandeln - Erweitert"
    click button "RGB"
    click button "Mehrkanal"
    end tell
    end tell
    keystroke return
    end tell
    end try



als Antwort auf: [#589209]