Applescript在网站输入文字(Applescript to input text in website)
set query to text returned of (display dialog "Enter Query" default answer "" buttons {"Input", "Cancel"} default button 1)
open location "http://www.soundcloud.com/"
delay 1
tell application "System Events"
key code 48
end tell
delay 1
query
所以我试图制作一个:
1)提示用对话框输入数据
2)打开网页
3)按Tab键进入第一个文本框
4)粘贴步骤1中的数据
我已经弄清楚如何进入第4步,但是当我打印查询变量时,它只在AppleScript中打印,而不是在网页上打印。
set query to text returned of (display dialog "Enter Query" default answer "" buttons {"Input", "Cancel"} default button 1) open location "http://www.soundcloud.com/" delay 1 tell application "System Events" key code 48 end tell delay 1 querySo i'm trying to make an applescript that:
1) Prompts with dialogue box to enter data
2) Opens up webpage
3) Presses tab to get to first text box
4) Pastes data from step 1
I've figured out how to get to up to step 4 but when i print the query variable it only prints it within the applescript not the webpage.
最满意答案
试试这个:
set query to text returned of (display dialog "Enter Query" default answer "" buttons {"Input", "Cancel"} default button 1) tell application "Safari" if not (exists document 1) then reopen activate set URL of document 1 to "http://rna.tbi.univie.ac.at/cgi-bin/RNAfold.cgi" delay 3 do JavaScript "document.getElementsByName('SCREEN')[0].value=" & quoted form of query & "" in document 1 end tell set query to text returned of (display dialog "Enter Query" default answer "" buttons {"Input", "Cancel"} default button 1) open location "http://www.soundcloud.com/" delay 1 tell application "System Events" key code 48 delay 1 keystroke query end tellI needed to add keystroke into the commandline
更多推荐
发布评论