【问题标题】:Rename window title in OS X with AppleScript or terminal使用 AppleScript 或终端重命名 OS X 中的窗口标题
【发布时间】:2016-06-05 02:04:05
【问题描述】:

我正在尝试使用 AppleScript 更改窗口标题,但没有成功。

告诉应用程序“Finder”将窗口名称“oldWinName”设置为“newWinName”

也试过了 使用参数 {"newWinName"}

调用 (window "oldWinName") 的方法 "setTitle:"

有什么想法吗?

问候

【问题讨论】:

标签: applescript


【解决方案1】:

哪个应用程序的窗口?

例如,对于 terminal.app

tell application "Terminal"
    set custom title of window 1 to "hello world"   
end tell

或者,对于 textedit.app

tell application "TextEdit"
    set name of window 1 to "hello world"
end tell

大多数应用程序都有类似的方法 :)

【讨论】:

  • osascript -e 'tell application "Terminal" to set name of front window to "hello world"' 真的不行,Terminal.app 会自己重命名
  • @localhostdotdev 你可以在“延迟1”之后进行
猜你喜欢
  • 2010-12-20
  • 1970-01-01
  • 2010-11-12
  • 2014-02-21
  • 1970-01-01
  • 2018-11-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多