Here's the script for moving forward 3 minutes:
tell application "iTunes" if player state is playing then -- length of current track: set trackTime to duration of current track --get the current position time: set currTime to get player position set currSkip to currTime + 180 -- checks if new position is greater than -- length of track, and corrects it if it is: if currSkip > trackTime then set currSkip to trackTime end if set player position to currSkip --skip to new position end if end tell...and here's one for skipping back 10 seconds:
tell application "iTunes" if player state is playing then --get the current track time: set currTime to get player position if currTime < 10 then --go to start of the track: set currSkip to 0 else --otherwise, skip backwards set currSkip to currTime - 10 end if set player position to currSkip --skip to new position end if end tellNote that the time is kept in seconds (not minutes). So to create scripts for varying amounts of time just edit the seconds and save as a separate script. Save in your user's "scripts" folder, ~/Library/Scripts/ as something like "skip3min.scpt".


3 comments: