问题描述
我无法将“ AXFrontmost”属性值更改为false
tell application "System Events"
set front_process to name of first process whose frontmost is true
tell process front_process
try
repeat while (value of attribute "AXFrontmost") is true
set value of attribute "AXFrontmost" to false
end repeat
on error
get properties of attribute "AXFrontmost"
end try
end tell
end tell
相对于属性属性“ AXFrontmost”,可设置的值为true
我发现强制最先设置为false的方法是切换可见状态:
repeat while (value of attribute "AXFrontmost") is true
set visible to false
delay 0.01
set visible to true
end repeat
repeat while (value of attribute "AXFrontmost") is true
key code 48 using command down
end repeat
那么,为什么会发生这种现象?假设 settable属性为true。
是否还有其他方法可以将属性“ AXFrontmost”的值强制设置为false?除了我上面已经提到的那些?
解决方法
嗯,只有一个进程可以位于最前面。
为此,我只是«告诉应用程序查找器激活» 这应该将每个进程的最前标志设置为false。 要将Finder的标志设置为false,应该可以«告诉我激活»。