Applescript在网站输入文字(Applescript to input text in website)

编程入门 行业动态 更新时间:2024-10-23 17:36:21
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 query

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

I needed to add keystroke into the commandline

更多推荐

本文发布于:2023-08-07 19:14:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1465966.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:输入文字   网站   Applescript   website   text

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!