如何点击" Go"按钮由applescript转到finder对话框?

时间:2017-06-07 08:04:31

标签: applescript

如何点击" Go"按钮由applescript转到finder对话框? 我有以下代码:" dialogObj"是Go to Finder对话框的对话框,但是"点击按钮1的searchFor"在这里不起作用。

-- 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

2 个答案:

答案 0 :(得分:0)

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

尝试

tell 1st sheet of dialogObj
    set textField to value of combo box 1
    click button "Go"
end

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

答案 1 :(得分:0)

你问:“如何点击”Go“按钮进入fincript对话框?” 你的意思是“转到文件夹”对话框,如下所示:

enter image description here

如果是这样,那么简单的RETURN将“点击”Go按钮:

national = geo.make(us="*")

Race_US <- acs.fetch(endyear = 2015, span = 1, geography = national, 
table.number = "DP04", col.names = "pretty")

Warning message:
In (function (endyear, span = 5, dataset = "acs", keyword, table.name,  :
  Sorry, no tables/keyword meets your search.
  Suggestions:
   try with 'case.sensitive=F',
   remove search terms,
   change 'keyword' to 'table.name' in search (or vice-versa)