How to Making a window transparent like VSCode?

tell application "System Events" to tell process "Code"

    -- set theWindow to window 1
    -- set value of attribute "AXAlphaValue" of theWindow to 0.5
    -- set background color to {47802,6909,1222, -20750}
    tell window 1
        set opaque to false
        set alpha  to 0.5
        set background  to {47802,6909,1222, -20750}
        -- set size to {1024, 768}
        set position to {100, 100}
    end tell
end tell

not work well

I don’t understand what you wrote. VSCode window is not transparent for me.

Do you want to make a transparent window by AppleScript + Cocoa?
スクリーンショット 2023-05-13 16.07.13
→ Yes, we can make half transparent window by AppleScript+ Cocoa

Do you want to make some application’s window transparent?
スクリーンショット 2023-05-13 16.07.29
→ Some application support transparency can accept its control. But VSCode is not scriptable application. So, you can not.