Merge pull request #10664 from dotCooCoo/fix/action-playback-current-artboard

Scripts: doScript steps act on the artboard the script made active
This commit is contained in:
.CooCoo authored and GitHub committed 2026-12-03 07:36:06 -08:00
commit fc19f5a42d
4 files changed
+18 -4

No files matched your search

+3 -2
View File
@@ -254,7 +254,7 @@ fn do_script(h: &Host, a: &[Data]) -> std::result::Result<Data, HostError> {
// Saved steps run as they run in the Actions panel: keys their commands no longer read are
// passed over.
// A document whose active artboard the script chose uses that choice, not the one the run
// started with.
// started with, nor the Artboard tool's selection from the start of the run.
let chosen = h.session.borrow().active().and_then(|st| {
h.dom.chosen_artboards.borrow().iter().find(|(uid, reverts)| *uid == st.uid && *reverts == st.reverts)?;
Some((st.uid, super::dom::active_artboard(st)))
@@ -263,7 +263,8 @@ fn do_script(h: &Host, a: &[Data]) -> std::result::Result<Data, HostError> {
Some(chosen) => std::slice::from_ref(chosen),
None => h.active_artboards.as_slice(),
};
let start = Start { active, picks: h.artboard_picks.as_ref(), batch: s.artboard };
let picks = h.artboard_picks.as_ref().filter(|(uid, _)| !chosen.as_ref().is_some_and(|(c, _)| c == uid));
let start = Start { active, picks, batch: s.artboard };
let params = on_active_artboard(&h.session.borrow(), &start, &s.id, &s.params);
let outer = h.session.borrow_mut().set_replaying(true);
let r = command(h, &s.id, &params);