2011-02-27 104 views
0

我有下面的代碼告訴iTunes從選擇轉換軌道,我想知道如何限制將被轉換的軌道長度?限制鈴聲長度Applescript

tell application "iTunes" 
    set theFiles to the selection 

    repeat with theTrack in theFiles 
     with timeout of 120 seconds 
      set theSecondTrack to first item of (convert theTrack) 

回答

0

如果您想通過iTunes GUI限制轉換曲目的長度,您可以在「獲取信息」>「選項」中設置原始曲目的「停止時間」。對應的AppleScript屬性是finish(的track類)。

因此,在你重複循環中的步驟應該是:

  1. 獲取軌道的原始停止時間(通常這隻會在賽道的全部時間)
  2. 將停止時間到你限制長度(以秒計)
  3. 轉換軌道
  4. 設置停止時間回到它是在1

實施例6 0秒限制:

repeat with theTrack in theFiles 
    tell theTrack 
     set originalFin to finish 
     set finish to 60 

     -- Track conversion code goes here 

     set finish to originalFin 
    end tell 
end repeat