Apple脚本:调整虚拟键盘/键盘查看器的大小和位置

时间:2011-11-22 11:01:37

标签: macos scripting keyboard applescript

如果1中有太多问题,请告诉我,我编辑问题并将其拆分为3个?问题

我目前正在编写一些苹果脚本并尝试使用它。

我想:

  • 打开虚拟键盘(keyboardViewer)
  • 调整大小
  • 定位
  • 停用close restoreminimize
  • 等控件

我的脚本是这些:

应用1:

tell application "System Events"
if not (exists (process "KeyboardViewer")) then
    do shell script "/usr/bin/keyboardViewer"
end if
end tell

App 2:

tell application "System Events"
if exists (process "KeyboardViewer") then
    click (process "KeyboardViewer"'s window 1's buttons whose subrole is "AXCloseButton")
end if
end tell

我在/usr/bin/

https://github.com/nriley/keyboardViewer使用了keyboardViewer

1 个答案:

答案 0 :(得分:0)

似乎我无法编写应用程序脚本。调整大小和定位适用于某些应用程序但不适用于此应用程序。也无法在mac os x中隐藏窗口左上角的控件。