0
Participant
,
/t5/photoshop-ecosystem-discussions/how-to-add-transition-by-script/td-p/11248357
Jun 28, 2020
Jun 28, 2020
Copy link to clipboard
Copied
Hello guys,
Please help me.
I try create an action to add transition but can't work. Is it possible with scripts?
I want add "Cross Fade" with duration 4s to all layer in Video group.
I appreciate any help.
Thank you so much!
TOPICS
Actions and scripting
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
1 Correct answer
Guide
,
Jun 29, 2020
Jun 29, 2020
* before starting the script, at least one layer in the desired video group must be selected
#target photoshop
var s2t = stringIDToTypeID,
p = app.activeDocument.activeLayer.parent,
len = p.layers.length - 1
for (var i = len; i > 0; i--) {
selectLayers([p.layers[i].id, p.layers[i - 1].id])
addTimelineTransition(4)
}
function selectLayers(IDList) {
var r = new ActionReference();
for (var i = 0; i < IDList.length; i++) { r.putIdentifier(s2t("layer"), IDList[i]) }
(d
...
Explore related tutorials & articles
Guide
,
/t5/photoshop-ecosystem-discussions/how-to-add-transition-by-script/m-p/11248646#M343789
Jun 29, 2020
Jun 29, 2020
Copy link to clipboard
Copied
* before starting the script, at least one layer in the desired video group must be selected
#target photoshop
var s2t = stringIDToTypeID,
p = app.activeDocument.activeLayer.parent,
len = p.layers.length - 1
for (var i = len; i > 0; i--) {
selectLayers([p.layers[i].id, p.layers[i - 1].id])
addTimelineTransition(4)
}
function selectLayers(IDList) {
var r = new ActionReference();
for (var i = 0; i < IDList.length; i++) { r.putIdentifier(s2t("layer"), IDList[i]) }
(d = new ActionDescriptor()).putReference(s2t("null"), r);
executeAction(s2t("select"), d, DialogModes.NO)
}
function addTimelineTransition(seconds) {
(d = new ActionDescriptor()).putObject(s2t("using"), s2t("crossDissolveTransition"), new ActionDescriptor());
(d1 = new ActionDescriptor()).putInteger(s2t("seconds"), seconds);
d.putObject(s2t("duration"), s2t("timecode"), d1);
d.putEnumerated(s2t("placement"), s2t("transitionPlacement"), s2t("join"));
executeAction(s2t("addTimelineTransition"), d, DialogModes.NO);
}
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
ANCHINGO
AUTHOR
Participant
,
LATEST
/t5/photoshop-ecosystem-discussions/how-to-add-transition-by-script/m-p/11251011#M344010
Jun 29, 2020
Jun 29, 2020
Copy link to clipboard
Copied
That's great! Thank you so much! Have a nice day!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

