Ausgabe
Die Bilder, mit denen ich arbeite, haben viele intelligente Objektebenen. Da es keine offizielle Möglichkeit gibt, den Inhalt aller Smart Objects auf einmal zu öffnen, denke ich darüber nach, dies mit AppleScript und JavaScript zu tun.
Ich habe jedoch ein Problem, wenn mein erstes Smart-Objekt geöffnet wird, bewegt sich der Fokus von Photoshop auf das neu geöffnete Bild (der Inhalt des bereits geöffneten Smart-Objekts). Also sollte der Fokus wieder auf die Originaldatei (die mit den vielen Smartobjekten) geändert werden, damit das nächste Smartobjekt geöffnet wird.
Es könnte etwas Einfaches sein, aber ich bin nicht sehr erfahren und konnte in den letzten Tagen keinen Weg finden, dies im Kontext von Photoshop zu tun.
Hier ist mein Code:
on run
tell application "Adobe Photoshop CS6"
activate
set Doc_Ref to the current document
set Doc_Name to name of Doc_Ref
tell Doc_Ref
set layerList to name of every layer in Doc_Ref whose kind is smart object layer
repeat with currentName in layerList
set current layer to layer currentName
my Edit_Smart_Layer()
end repeat
end tell
end tell
end run
on Edit_Smart_Layer()
tell application "Adobe Photoshop CS6"
do javascript "editSmartLayer(); function editSmartLayer() { function cTID(s) { return app.charIDToTypeID(s); }; function sTID(s) { return app.stringIDToTypeID(s); }; var desc01 = new ActionDescriptor(); executeAction( sTID('placedLayerEditContents'), desc01, DialogModes.NO );};" show debugger on runtime error
end tell
end Edit_Smart_Layer
PS Ich denke, der Code sollte auch prüfen, ob die Smart-Objekt-Ebene sichtbar ist.
Lösung
Die Lösung ist:
on run {input}
try
tell application "Adobe Photoshop CS6"
activate
set Doc_Ref to the current document
tell Doc_Ref
try
set layerList to name of every layer in Doc_Ref whose kind is smart object layer
on error
display dialog "The active picture does not have Smart Object Layers !"
return input
end try
repeat with currentName in layerList
set current layer to layer currentName
my Edit_Smart_Layer()
tell application "Adobe Photoshop CS6"
set current document to Doc_Ref
end tell
end repeat
display dialog "Opened Smart Objects: " & length of layerList
end tell
end tell
on error
display dialog "Please run Photoshop and open a picture !"
return input
end try
end run
on Edit_Smart_Layer()
tell application "Adobe Photoshop CS6"
do javascript "editSmartLayer(); function editSmartLayer() { function cTID(s) { return app.charIDToTypeID(s); }; function sTID(s) { return app.stringIDToTypeID(s); }; var desc01 = new ActionDescriptor(); executeAction( sTID('placedLayerEditContents'), desc01, DialogModes.NO );};" show debugger on runtime error
end tell
end Edit_Smart_Layer
Beantwortet von – OutOfTouch
Antwort geprüft von – Dawn Plyler (FixError Volunteer)