Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何点击";围棋;通过applescript转到查找器对话框上的按钮?_Applescript - Fatal编程技术网

如何点击";围棋;通过applescript转到查找器对话框上的按钮?

如何点击";围棋;通过applescript转到查找器对话框上的按钮?,applescript,Applescript,如何通过applescript单击“转到查找器”对话框上的“转到”按钮? 我有下面的代码:“dialogObj”是Go to Finder对话框的对话框,但“searchFor的单击按钮1”在这里不起作用 -- Get the search for pop-up object set searchFor to first sheet of dialogObj -- Select all the text in the search field and press delete key code

如何通过applescript单击“转到查找器”对话框上的“转到”按钮? 我有下面的代码:“dialogObj”是Go to Finder对话框的对话框,但“searchFor的单击按钮1”在这里不起作用

-- Get the search for pop-up object
set searchFor to first sheet of dialogObj

-- Select all the text in the search field and press delete
key code 0 using command down
key code 51
delay 0.5
--Paste file name
keystroke "v" using {command down}
delay 0.5

-- Click the 'Go' button in the search for pop-up
set textField to value of first text field of first sheet of dialogObj
*click button 1 of searchFor*
delay 1

在macOS Sierra中,文本字段已替换为组合框:

试一试

顺便说一下:如果您选择了整个文本,则无需按
Delete
。任何粘贴或键入的文本都会覆盖所选内容。

您问:“如何通过applescript单击“转到查找器”对话框上的“转到”按钮?” 您的意思是“转到文件夹”对话框,如下所示:

如果是,则简单的返回将“单击”Go按钮:

tell application "System Events"    
  key code 36
end tell

它不能按照你的建议很好地工作,我的脚本可以在mac os 10.10中很好地工作,在我将os版本更新到10.12之后就不能工作了好的,它可以工作了。谢谢在版本10.12中,文本字段控件更改为组合框控件
tell application "System Events"    
  key code 36
end tell