【发布时间】:2015-11-25 22:52:28
【问题描述】:
我正在尝试让一个自动程序 applescript 循环通过逗号分隔的列表;并在此过程中粘贴值 1、选项卡、粘贴值 2、选项卡等...
它似乎不想粘贴到谷歌浏览器的文本字段中。
display dialog "What is the list? (Artist, Song Title, Artist, Song Title)" default answer "Frank Sinatra, My Way, Elvis, Blue Christmas"
set user_input to text returned of result
set {myTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {","}}
set myList to text items of user_input -- Gives list {"2", "69", "12"}
set AppleScript's text item delimiters to myTID -- It's considered good practice to return the TID's to their original state
repeat with myItem in myList -- Loop through the items in the list
tell application "System Events"
set the clipboard to myItem
keystroke "v" using {command down}
keystroke tab
end tell
delay 1
end repeat
display dialog "Job Done"
return
【问题讨论】:
-
您好,请不要在您的问题中发布有效的解决方案,如果该解决方案与 pbell 答案不同,请使用该内容自己编写另一个答案。否则,将答案标记为已接受并投票即可完成工作:)
标签: macos applescript automator