0
我想遍歷iTunes窗口上的每個元素並嘗試點擊每個元素。applescript通過gui腳本點擊每個元素
我也想寫一個文本文件來顯示我點擊過的每個元素。
我在下面寫的代碼不起作用。具體來說,我得到錯誤過程「iTunes」不理解click_an_element消息。
關於我在做什麼錯的想法?
謝謝!
tell application "iTunes" to activate
tell application "System Events"
tell process "iTunes"
set elements to get entire contents of window "iTunes"
repeat with i from 1 to (length of elements)
set ele to item i of elements
click_an_element(ele)
show_what_you_clicked(ele)
end repeat
end tell
end tell
-------handlers------------
to click_an_element(an_element)
tell application "iTunes" to activate
tell application "System Events"
tell process "iTunes"
try
click an_element
end try
end tell
end tell
end click_an_element
to show_what_you_clicked(thing_to_type)
tell application "TextEdit" to activate
tell application "System Events"
tell process "TextEdit"
keystroke thing_to_type
key code 36
end tell
end tell
end show_what_you_clicked
omfg謝謝.. ..! – user141146 2010-06-14 17:52:05
@ user141146很高興我可以幫助不知道爲什麼你想做這樣的事情.... – mcgrailm 2010-06-14 20:43:56