2014-09-05 82 views

回答

2

我幾年沒見過錄音工作。不過,在這種情況下,我不確定它可以。雖然iTunes是可編寫腳本的,但它似乎沒有任何直接的手段來執行商店搜索。

但是,有一種方法可以使用URL和「打開位置」執行搜索。它看起來是這樣的:

tell application "iTunes" 
    open location "itms://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?WOURLEncoding=ISO8859_1&lang=1&output=lm&country=US&media=software&term=ia%20Writer" 
end tell 

把你要搜索&後術語的文本=;這裏,ia%20Writer(%20表示空格)。

這結合了來自Ars TechnicaDoug’s AppleScripts的信息。

0

這裏有一個方法,你可以使用的AppleScriptdisplay dialog要輸入的內容應用使用傑裏·斯特拉頓提供的答案搜索在iTunes商店

  • 如果搜索空格在裏面,腳本替換爲%20給你。

set theAppSearch to "" 
set theAppSearch to text returned of (display dialog "App Search iTunes Store for:" default answer "" buttons {"Cancel", "OK"} default button 2) 
if theAppSearch is not "" then 
    set theAppSearch to my replaceSpaces(theAppSearch) 
    tell application "iTunes" 
     activate 
     open location "itms://phobos.apple.com/WebObjects/MZSearch.woa/wa/search?WOURLEncoding=ISO8859_1&lang=1&output=lm&country=US&media=software&term=" & theAppSearch 
    end tell 
end if 
on replaceSpaces(theString) 
    set AppleScript's text item delimiters to {" "} 
    set theString to text items of theString 
    set AppleScript's text item delimiters to {"%20"} 
    set theString to theString as text 
    set AppleScript's text item delimiters to {""} 
    return theString 
end replaceSpaces 
相關問題