我有一段代码可以返回输入语言的当前值
tell process "SystemUIServer" to
get the value of the first menu bar item of menu bar 1
whose description is "text input"
tell end
现在我想用IF Else
检查结果,但是我不知道该怎么做!
谢谢
答案 0 :(得分:1)
首先,您必须告诉System Events
来完成这项工作。
只需将结果分配给变量
activate application "SystemUIServer"
tell application "System Events"
tell process "SystemUIServer"
set textInput to (get value of the first menu bar item of menu bar 1 whose description is "text input")
end tell
end tell