2011-02-27 1 views
0

iTunes에서 트랙을 선택 항목으로 변환하라고 알려주는 코드가 있습니다. 변환 될 트랙의 길이를 어떻게 제한합니까? 당신은 아이튠즈 GUI를 통해 변환 된 트랙의 길이를 제한하고 싶다면Limit Ringtone Length 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

, 당신은 정보 입수> 옵션에서 원래 트랙의 "정지 시간"을 설정합니다. 이것에 해당하는 AppleScript 속성은 finish (track 클래스)입니다.

그래서 당신의 반복 루프의 단계는 다음과 같아야합니다

  1. 트랙의 원래 정지 시간 (일반적으로 이것은 단지 트랙의 전체 지속 시간이 될 것입니다) 가져
  2. 는에 정지 시간을 설정하여 (초) 제한 길이
  3. 이되면 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