tell application - string vs. string?

一个人想着一个人 提交于 2019-12-04 20:08:19

The argument of tell application is required be a literal string (a constant) because the terminology is evaluated at compile time.

The alternative is an using terms from application block but the argument requires a literal string, too

using terms from application "Maps"

end using terms from

This works for me using the latest version of Sierra

set applicationName to "Maps"
tell application applicationName
    tell its windows
        set miniaturized to false
    end tell
end tell

This also works for me

set applicationName to "Maps"
tell application applicationName's windows to set miniaturized to false

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!