2012-03-22 66 views
0

我有一个applescript在iTunes中获取当前专辑名称,并设置为剪贴板。我怎样才能打开一个网址,例如,谷歌专辑名称?在applescript中打开一个url

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

查看答案http://apple.stackexchange.com/questions/ 18487 /其中,并-URL访问脚本 - 应用 - 去 - 在狮 – 2012-03-22 14:31:53

回答

2

简单: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