gpt4 book ai didi

macos - AppleScript 单击对话框

转载 作者:行者123 更新时间:2023-12-04 12:26:47 25 4
gpt4 key购买 nike

在 PCSX(ps1 模拟器)中,我正在尝试自动执行播放 iso 的步骤。所以,我这样做:

set thepath to path to me
set thesecondpath to POSIX path of thepath
set thethirdpath to "Contents/PSX/ROMS/img.bin"
set thefourthpath to "/Contents/PSX/PCSX.app"
set thefifthpath to thesecondpath & thefourthpath
set theultimatepath to thesecondpath & thethirdpath

tell application thefifthpath
activate
tell application "System Events"
keystroke "i" using {command down}
keystroke theultimatepath
delay 1.0
tell process "PCSX"
click button "Go"
end tell
key code 53
end tell
end tell

从 AppleScript 编辑器运行将不起作用。我让它从它创建的应用程序运行。 PCSX 和 img.bin 位于生成的包内。

按下 command+i 后,它会打开一个 “Go to the folder” 对话框,我需要点击 Go 然后 打开

但是这样做,它不会找到对话框。我做错了什么?

最佳答案

如果 Go 和 Open 是默认按钮,请尝试:

tell application "System Events"
keystroke return
delay 2
keystroke return
end tell

虽然我没有安装 PCX,但这里有一个示例,说明如何从 Finder 的转到文件夹命令中单击转到按钮。

tell application "System Events"
tell process "Finder"
click button "Go" of window "Go to Folder"
end tell
end tell

关于macos - AppleScript 单击对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14315940/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com