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:
Hello, I'm a newbie in applescripting (and when I say "newbie" I mean I started reading this post... :-)
I'm using the widget Harmonic which auto-embeds lyrics in the mp3s (or at least it tries...)
It works quite simply, when dashboard is opened and a song is playing it automatically looks for the lyrics online and embeds them if it finds them, in a couple of seconds.
What I would like my mewbie-beginner-lazy script to do for me is to go to the next track after every 5 or 10 seconds from the beginning of every track so to have them all filled with lyrics.
Now the questions: how can I tell iTunes to do this after 5 seconds? Do I have to loop it? How? Can I then tell him to make a playlist with just the tracks with no lyrics? (maybe this is already a step forward...)
Thanks for the help, I hope I won't have to ask such stupid questions in the future... :-P
Not a stupid question at all. It's a good idea. I'm unfamiliar with this widget "Harmonic", I think it will depend on how much applescript support it has. If you open Script Editor then go File->Open Dictionary and then find the Harmonic program (and open it) you can see what is supported.
Wow. I'd been looking for a rewind script for a long time. This works perfectly.
Post a Comment