繁体   English   中英

在AppleScript中打开一个网址

[英]open a url in applescript

我有一个AppleScript来获取iTunes中的当前专辑名称,并设置为剪贴板。 我如何打开网址,例如谷歌专辑名称?

tell application "iTunes"
    set track_album to the album of the current track
    set the clipboard to track_album
end tell

简单: tell application "Safari" to search the web for track_album

这将使用Safari的默认搜索引擎进行搜索。 如果您想在特定网站上进行自定义搜索,例如Last.fm,您可以撰写如下搜索查询:

set query to "http://www.last.fm/search?q=" & track_album & "&type=album"
tell application "Safari" to open location query

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM