AppleScript:在Safari Windows之间切换?
如果我打开了两个Safari Windows,则每个标签只有一个选项卡,如何将AppleScript随意切换到任何一个Windows?或换句话说,在它们之间切换。
我尝试过,激活窗口1
(或第一个窗口),激活窗口2
(或第二个窗口),只能激活第一个窗口。
我尝试了打开窗口1
等,不存在打开。
我尝试使用系统事件,单击菜单栏1选项
,以为菜单栏2是窗口2,而无效。
我尝试在特定的选项卡上显示do javaScript
,该页面无法正常工作。
最终,我确实弄清楚了我可以使用键盘快捷键,但是我想看看是否有更多的“香草” applescript方式。
If I have two safari windows open, just one tab in each, how do I get applescript to switch to either of the windows at will? Or in other words, toggle between them.
I tried, activate window 1
(or, the first window), and activate window 2
(or the second window), only ever activates the first window.
I tried open window 1
etc, open doesn't exist.
I tried using the system events, click menu bar 1 option
, thinking maybe menu bar 2 was for window 2, didn't work.
I tried making do javascript
on a specific tab show that page, couldn't get that to work.
Ultimately I did figure out I could use a keyboard shortcut, but I wanted to see if there was a more 'vanilla' applescript way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果窗口不是全屏(在不同的空间中),只需更改窗口的
index
如果窗口在不同的空间中,则必须通过使用
执行键盘来切换空格。系统事件
。美国键盘上的默认值是⌃←和⌃→
If the windows are not full screen (in different spaces) just change the
index
of the windowIf the windows are in different spaces you have to switch the spaces by executing the keystrokes with
System Events
. The default values on the US keyboard are ⌃←and ⌃→
当我这样做时,
出现的新窗口被冻结了。我这样解决了这个问题
When I do just this
The new window that shows up is frozen. I fixed this by doing this