苹果脚本按钮

发布于 2024-10-04 19:38:58 字数 299 浏览 2 评论 0原文

我已遵循此 YouTube 教程:http://www.youtube.com/watch?v=0ux3S_G8HuU< /a>

我想要第二个按钮转到一个特殊网站......

我已经尝试过:

if "button 2" then open location "(the name of the site)"

我该怎么办?我希望你能帮忙。

I have followed this youtube tutorial: http://www.youtube.com/watch?v=0ux3S_G8HuU

I want the second button go to a special website....

I have tried this:

if "button 2" then open location "(the name of the site)"

What do I do? I hope you can help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

迷爱 2024-10-11 19:38:58

试试这个:

set search to (display dialog "Enter YouTube Video Search" default answer "" buttons {"Cancel", "Search", "Search2"} default button 3)
set keyword to text returned of search
set buttonPressed to button returned of search

if buttonPressed is equal to "Search" then
tell application "Safari"
    open location "http://www.youtube.com/results?search_query=" & keyword
end tell
else if buttonPressed is equal to "Search2" then
tell application "Safari"
    open location "http://www.youtube.com/results?search_query=" & keyword
end tell
end if

只需将 URL 更改为您想要的“搜索”或“搜索2”即可。

Try this:

set search to (display dialog "Enter YouTube Video Search" default answer "" buttons {"Cancel", "Search", "Search2"} default button 3)
set keyword to text returned of search
set buttonPressed to button returned of search

if buttonPressed is equal to "Search" then
tell application "Safari"
    open location "http://www.youtube.com/results?search_query=" & keyword
end tell
else if buttonPressed is equal to "Search2" then
tell application "Safari"
    open location "http://www.youtube.com/results?search_query=" & keyword
end tell
end if

Just change the URLs to whatever you want for Search or Search2.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文