我每天都在浏览网站几次,并且禁用了一个按钮,我必须从开发人员菜单/元素中手动启用它
<div class="actioning-buttons">
<button class="action-button one-action-button" disabled="">Number 1</button>
</div>
Run Code Online (Sandbox Code Playgroud)
我是否可以自动为此数据库/网站启用此功能而无需一直进行手动编辑?
PS Im使用Google Chrome for OSX
我无法找到如何将所选文本用作AppleScript和Automator的变量.
有任何想法吗?
我尝试获取应用程序的标题(并将其复制为 var)\n这是到目前为止我的代码,但失败了
\n\ntell application "app"\n activate\nend tell\n\ntell application "System Events"\n set frontApp to name of first application process whose frontmost is true\nend tell\n\ntell application frontApp\n if the (count of windows) is not 0 then\n set window_name to name of front window\n end if\nend tell\nRun Code Online (Sandbox Code Playgroud)\n\n结果 :
\n\n\n\n错误“应用程序出现错误:每个窗口\xe2\x80\x99无法理解\xe2\x80\x9ccount\xe2\x80\x9d消息。” 每个窗口的数字 -1708
\n
我以前使用AppleScript多年,但几天后,我再也无法运行了
我有错误消息
"dyld:未加载库:/usr/lib/libnetsnmp.25.dylib引用自:/ usr/bin/php原因:找不到图像""dyld:未加载库:/usr/lib/libnetsnmp.25.dylib引用来自:/ usr/bin/php原因:未找到图片(1005)"我知道如何解决这个问题
非常感谢
set r to ""
set device to "IPHONE 6 PLUS SILVER 128GB-AUS"
set HighValueDevicesPass to {"IPHONE 7", "IPHONE 6", "IPAD PRO", "IPHONE 6S", "IPHONE 6 PLUS"}
if devices contains HighValueDevicesPass then
set r to "Pass"
end if
return r
Run Code Online (Sandbox Code Playgroud)
我不明白为什么这不起作用。该变量是“IPHONE 6 PLUS SILVER 128GB-AUS”,因此实际上包含列表中的“IPHONE 6 PLUS”。
如果我使用 IF is on the list,它工作正常,但随后我必须将所有不同的模型设置为变量。
如何进行部分匹配?
我的Applescripts自从我上次系统更新以来,我每天都运行以从Safari获取文本
它曾经只在Safari中工作,而不是在Safari预览版中工作,我想Safari预览系统现在可以用于Safari
tell application "Safari"
set DinfoGrab to do JavaScript "
document.getElementsByClassName(' field type-string field-Dinfo ')[0].innerHTML;" in tab 3 of window 1
end tell
Run Code Online (Sandbox Code Playgroud)
有这个错误:
Safari出错:无法生成"document.getElementsByClassName('field type-string field-Dinfo')[0] .innerHTML;" 到文本类型.
我该如何解决这个问题?谢谢.
更新:
以下是与Chrome完美配合的内容:
tell application "Google Chrome"
tell tab 3 of window 1 to set r to execute javascript "document.getElementsByClassName('field type-string field-Dinfo')[0].innerHTML;"
end tell
Run Code Online (Sandbox Code Playgroud) 我尝试填充文本字段但不能
activate application "****"
tell application "System Events"
tell process "****"
tell text field 1 of window 1
set value of text field 1 to "here is the text"
end tell
end tell
end tell
Run Code Online (Sandbox Code Playgroud) 我有一个脚本,用于查找名称并搜索与另一个变量的匹配项。
它工作正常,但是如果变量 1 是“Name Demo”而变量 2 是“Demo Name”,则脚本找不到匹配项。
set nameMatchTXT to ""
if NameOnDevice contains theName then
set nameMatch to theName & " : Name Match"
end if
Run Code Online (Sandbox Code Playgroud)
无论如何改变这个以找到匹配的顺序?PS 脚本正在寻找单词通配符,有时处理双位字符可能会很困难。
我想在按标签时将文本保存到剪贴板.
我尝试过UIPasteboard但Xcode 7无法识别
所以基本上我坚持基本的:
@IBAction func label1(sender: AnyObject) {
}
Run Code Online (Sandbox Code Playgroud) 我想创建一个 AppleScript 来单击菜单,但我无法使用我使用的脚本,这是我想要的菜单:
ELEMENT :
Role : menu item
Title: "sign in As..."
Description :
Help:
Application: SytemUIServer
ELEMENT PATCH (starting at leaf element):
menu Item "Sign in As..." (menu item 12)
menu (menu 1)
menu extra (menu bar item 2)
menu bar (menu bar 1)
application "SystemUIServer"
Run Code Online (Sandbox Code Playgroud)
所以我做了几个脚本,最后一个是
ignoring application responses
tell application "System Events" to tell process "SystemUIServer"
click menu bar item 2 of menu bar 1
end tell
end ignoring
do shell script "killall System\\ Events"
delay …Run Code Online (Sandbox Code Playgroud) 我有一个 AppleScript 保存为应用程序,我每天运行它几次,并且我想添加一个计数器。
property currentCount : 0
increment()
on increment()
set currentCount to currentCount + 1
display dialog "Count is now " & currentCount & "."
end increment
Run Code Online (Sandbox Code Playgroud)
即使我关闭并再次打开它,每次脚本运行时都会添加 1,但如何重置它?
我的意思是,目标是每天计算“病例”的数量,然后在第二天重新开始。
怎样才能第二天自动重置?
干杯