2010-07-22 53 views

回答

9

我不記得寫這個,我在MacRumors論壇上從response to a post提起代碼。

tell application "Finder" 
    set Names to paragraphs of (read (choose file with prompt "Pick text file containing track names")) 
    repeat with nextLine in Names 
    if length of nextLine is greater than 0 then 
     --Do something with the next name, which is stored in "nextLine" 
    end if 
    end repeat 
end tell 

MacRumors論壇上的原始代碼積分爲HexMonkey

+3

有沒有必要告訴Finder做這些事情。您應該將所有代碼從Finder tell塊中取出。 Applescript可以自己處理這些代碼,Finder經常忙於其他任務,所以它甚至可能會減慢代碼的速度。 – regulus6633 2010-07-23 16:40:58

+0

很高興知道。我真的應該自己學習這些日子之一。 :P – kdmurray 2010-07-23 18:47:22