diff --git a/.claude/skills/cfe-borrow/scripts/cfe-borrow.ps1 b/.claude/skills/cfe-borrow/scripts/cfe-borrow.ps1 index 0b526b35..89bbe6c6 100644 --- a/.claude/skills/cfe-borrow/scripts/cfe-borrow.ps1 +++ b/.claude/skills/cfe-borrow/scripts/cfe-borrow.ps1 @@ -476,13 +476,23 @@ function Borrow-Form { $formVersion = $srcFormEl.GetAttribute("version") if (-not $formVersion) { $formVersion = "2.17" } - # Find direct children: AutoCommandBar, ChildItems (visual elements only) + # Find direct children: form properties, AutoCommandBar, ChildItems $srcAutoCmd = $null $srcChildItems = $null + $formProps = @() + $reachedVisual = $false foreach ($fc in $srcFormEl.ChildNodes) { if ($fc.NodeType -ne 'Element') { continue } - if ($fc.LocalName -eq 'AutoCommandBar' -and -not $srcAutoCmd) { $srcAutoCmd = $fc } - elseif ($fc.LocalName -eq 'ChildItems' -and -not $srcChildItems) { $srcChildItems = $fc } + if ($fc.LocalName -eq 'AutoCommandBar' -and -not $srcAutoCmd) { + $reachedVisual = $true; $srcAutoCmd = $fc; continue + } + if ($fc.LocalName -eq 'ChildItems' -and -not $srcChildItems) { + $reachedVisual = $true; $srcChildItems = $fc; continue + } + if (-not $reachedVisual) { + # Form-level properties before AutoCommandBar (WindowOpeningMode, AutoFillCheck, etc.) + $formProps += $fc.OuterXml + } } # Get OuterXml and strip redundant namespace redeclarations (they're on root