Applescript-获取执行命令的窗口的终端窗口号

问题描述 投票:0回答:1

我正在尝试将命令应用于运行它的特定窗口。例如:

osascript -e "tell application \"Terminal\" to set the font size of window 1 to 14"

[如果您打开了多个窗口,则可以在运行命令的窗口上运行,也可以在其他窗口之一上运行,这取决于它是否在同一台显示器上聚焦,不聚焦...我想替换[ C0]和window 1之类的内容,因此我的意思是始终是运行脚本的窗口。

shell applescript tty
1个回答
0
投票

如果始终总是从命令行手动执行,则将执行以下操作:

currentWindow

也会:

osascript -e 'tell application "Terminal" to set the font size of the front window to 14'

由于osascript -e 'tell application "Terminal" to set the font size of window 1 to 14 在此上下文中始终为front window

© www.soinside.com 2019 - 2024. All rights reserved.