I have 3 displays, MacBook and 2x4k. My main display is one of 4k. The issue is when I lock computer often 2nd 4k Display (not main) move all full screen apps to MacBook, MacBook to this 4k. Only main display have apps on place. To solve this issue I have to open preferences/ display/ arrangement and move white bar from main display to MacBook, than "not main 4k" and to "main" 4k. In conclusion I have to move white bar 3 times. This is really uncomfortable and I wonder how to do it wit apple script. Right now I find solution to open system preferences-> display -> arrangement, however I have no idea how to move white bar around displays. My code is here:
-- QUIT SYSTEM PREFERENCCES APPLICATION
if application "System Preferences" is running then
tell application "System Preferences" to quit
delay 1
end if
tell application "System Preferences"
activate
set the current pane to pane id "com.apple.preference.displays"
delay 1
tell application "System Events"
click radio button "Rozmieszczenie" of tab group 1 of window "LG Ultra HD (1)" of application process "System Preferences"
end tell
end tell
Can anyone help me how to finish script?
Thank you!
cscreen
commnd appropriately to achieve the goal.