Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Skip a few seconds forward/backward in iTunes Apps
I listen to podcasts within iTunes. Sometimes, I like to skip through some material (e.g. ads or music or whatever). I used two extremely simple AppleScripts that will do just that (forward or backward).

I activate them using iKey, although any macro program would do. The skipped duration can be altered by the user by modifying the scripts.

Skip forward:
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
    --to set new position to 10 seconds ahead:
    set currSkip to currTime + 10
    
    -- 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
Skip backward:
tell application "iTunes"
  if player state is playing then
    --get the current track time:
    set currTime to get player position
    --if track is less than 10 seconds:
    if currTime < 10 then
      --go to start of the track:
      set currSkip to 0
    else
      --otherwise, skip backwards 10 seconds:
      set currSkip to currTime - 10
    end if
    
    set player position to currSkip --skip to new position
  end if
  
end tell
The scripts should work only if iTunes is currently playing a track, and do not work when playing live MP3 streams.
    •    
  • Currently 3.29 / 5
  You rated: 3 / 5 (7 votes cast)
 
[17,233 views]  

Skip a few seconds forward/backward in iTunes | 9 comments | Create New Account
Click here to return to the 'Skip a few seconds forward/backward in iTunes' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Skip a few seconds forward/backward in iTunes
Authored by: dpmorri on Jul 27, '05 10:33:04AM

you can also skip a few seconds forward or back in any track if you just hit "command-option" and either the Right or Left arrows



[ Reply to This | # ]
THANK YOU! (nt)
Authored by: nick on Jul 27, '05 11:05:44AM

.



[ Reply to This | # ]
THANK YOU! (nt)
Authored by: infodriveway on Jul 27, '05 03:00:55PM

this is sooooo nice to know. thanks for that tip.

if anyone else cares, it's a quick way to skip five seconds foward.

---
there is nothing special about equal rights.



[ Reply to This | # ]
And on the GUI...
Authored by: MattHaffner on Jul 27, '05 09:44:38PM

These are identical to holding down the forward/back buttons on the players panel. If you simply click them, you move by track. If you hold them down you skip within the track. Pretty much like most CD players I've used over the years.



[ Reply to This | # ]
Skip a few seconds forward/backward in iTunes
Authored by: leenoble_uk on Jul 27, '05 01:40:55PM

Coincidentally I wrote a script to do likewise today, but it was alot shorter than that.


tell application "iTunes"
set player position to (player position + 150)
end tell

Actually it was part of an extension to my own remote control which I usually use through QuickTime. I have scripts which record radio streams and then I use Salling Clicker to play them back in date order (a sort of home brew podcasting system for times when there is no podcast option). I have the numbers 3,6 and 9 on my phone set to skip 150 seconds, 30 seconds and 10 seconds respectively. 1 is set to skip back by 10 seconds. It makes it simple to skip past songs I don't want to listen to in a few taps. Since I've recently (since 4.9) started subscribing to podcasts I wanted the same facility when playing through iTunes. So I am now in the process of combining the scripts so that they can tell which application I am currently listening through and perform the skips in the correct app.

They're not quite ready yet I was hoping to finish them up this week. Perhaps I'll post a link in this thread when I'm done.

---
So, I said ... well, I can't actually remember exactly what I said. But it was one of the most enormously cruel and frighteningly witty put downs ever.

[ Reply to This | # ]

Skip a few seconds forward/backward in iTunes
Authored by: leenoble_uk on Jul 27, '05 01:47:52PM

Sorry, I see yours does some more error checking, mine doesn't bother since it's only me using it at the moment.

Apologies for double post, it wouldn't connect for 5 minutes (site not found) and then when it went there were two posts.

---
So, I said ... well, I can't actually remember exactly what I said. But it was one of the most enormously cruel and frighteningly witty put downs ever.



[ Reply to This | # ]
Skip a few seconds forward/backward in iTunes
Authored by: leenoble_uk on Jul 27, '05 01:44:00PM

Coincidentally I wrote a script to do likewise today, but it was alot shorter than that.


tell application "iTunes"
set player position to (player position + 150)
end tell

Actually it was part of an extension to my own remote control which I usually use through QuickTime. I have scripts which record radio streams and then I use Salling Clicker to play them back in date order (a sort of home brew podcasting system for times when there is no podcast option). I have the numbers 3,6 and 9 on my phone set to skip 150 seconds, 30 seconds and 10 seconds respectively. 1 is set to skip back by 10 seconds. It makes it simple to skip past songs I don't want to listen to in a few taps. Since I've recently (since 4.9) started subscribing to podcasts I wanted the same facility when playing through iTunes. So I am now in the process of combining the scripts so that they can tell which application I am currently listening through and perform the skips in the correct app.

They're not quite ready yet I was hoping to finish them up this week. Perhaps I'll post a link in this thread when I'm done.

---
So, I said ... well, I can't actually remember exactly what I said. But it was one of the most enormously cruel and frighteningly witty put downs ever.

[ Reply to This | # ]

SizzlingKeys
Authored by: Thom on Aug 15, '05 11:39:43AM

I used to use Keyboard Maestro to control iTunes behavior, but stopped being interested in using it. So now I use SizzlingKeys, from YellowMug.com, which has that functionality in the pro mode ($5).



[ Reply to This | # ]
Skip a few seconds forward/backward in iTunes
Authored by: xhinter on Apr 06, '13 09:12:19AM

I use the following scripts in iTunes 11.0.2 & OS X 10.8.3

Step forward

property step : 3
tell application "iTunes"
	if player state is playing then
		if ((player position) + step) ≤ (duration of current track) then
			set (player position) to ((player position) + step)
		else
			set (player position) to (duration of current track as integer)
		end if
	end if
end tell

Step backward

property step : 3
tell application "iTunes"
	if player state is playing then
		if ((player position) - step) ≥ 0 then
			set (player position) to ((player position) - step)
		else
			set (player position) to 0
		end if
	end if
end tell


[ Reply to This | # ]