2012-03-22 77 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