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

Add step forward/backward feature to QuickTime Player Apps
Whenever I'm using QuickTime Player, I miss the Option-Command-right/left arrow keystrokes to step forward/backward, which I've grown accustomed to in VLC. Here's how to bring these to QuickTime Player, using Butler.

Disclaimer/note: Being the creator of Butler, it shouldn't come as a surprise that I use Butler for these things. There are other ways of launching these AppleScripts, but this solution is definitely easy to implement if Butler is already running on your Mac.

Step Forward:

Open Butler's main window, create a new AppleScript Smart Item (click the Plus sign icon, then Smart Item: AppleScript: AppleScript) and name it QT: Step Forward, for instance. Then, paste the following script to the Inspector's Source Code section for your new Smart Item:
property step : 10
tell application "QuickTime Player"
  set playerPosition to (current time of front movie) + 
    (step * (time scale of front movie))
  set movieDuration to duration of front movie
  if (playerPosition ? movieDuration) then
    if front movie is playing then
      stop front movie
    end if
    set playerPosition to movieDuration
  end if
  set current time of front movie to playerPosition
end tell
This script will trigger 10-seconds steps. If you want a different value, edit the property step: line accordingly.

Now, go to the Inspector's Triggers section, and enter your hot key of choice -- I'm using Option-Command-Right Arrow, as mentioned above. Once you've entered the hot key, configure the Exceptions pop-up to be Only valid in, and then list QuickTime Player for the application's name.

Step Backward

This script is almost the same, except for the AppleScript we're using:
property step : 10
tell application "QuickTime Player"
  set playerPosition to (current time of front movie) - 
    (step * (time scale of front movie))
  if (playerPosition < 0) then
    set playerPosition to 0
  end if
  set current time of front movie to playerPosition
end tell
Once again, change the property step line to change the jump increment. And that's it; you're done. Switch to QuickTime Player and start up a movie, and test your new keys.

[robg adds: I tested these, and they work as described.]
    •    
  • Currently 1.75 / 5
  You rated: 4 / 5 (4 votes cast)
 
[19,623 views]  

Add step forward/backward feature to QuickTime Player | 18 comments | Create New Account
Click here to return to the 'Add step forward/backward feature to QuickTime Player' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Add step forward/backward feature to QuickTime Player
Authored by: leenoble_uk on Nov 11, '05 08:49:47AM

I've been using almost identical scripts that I wrote myself ages ago. I use three different lengths of skip forward (150, 30 and 10) and two of skip backwards (12, 4). I have these mapped using Salling Clicker to 3, 6 and 9 for forward and 1 and 4 for backwards. They enable me to skip around radio shows I have recorded. The skip lengths I have chosen make it simple to skip 3 minute ad breaks with a quick 3,6 and songs I don't like with a 3 a 6 or two and as many 9's as it takes to reach the end of the track.
It's a lot faster than the description believe me.

I've also used PearScriptKeys to add the same functionality to my numeric keypad in case my phone is not connected only with the numbers reversed because the keypad is upside down compared to the phone.

By not limiting yourself to controlling while QuickTime Player is active you can listen to audio files and skip around them in the background without needing to bring QT to the front.

Also my script determines whether I am using QT or iTunes to listen and skips forward the appropriate amount in the correct application.

---
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 | # ]
Add step forward/backward feature to QuickTime Player
Authored by: donquichote on Nov 11, '05 09:16:19PM
Nice Hint! In the first script I had to use > instead of ?.

[ Reply to This | # ]
Add step forward/backward feature to QuickTime Player
Authored by: Peter Maurer on Nov 13, '05 11:29:27AM

Right. The original script had an ">=" operand, but Rob seems to have compiled the scripts before pasting them -- the ScriptEditor replaces composed operands by non-ascii (and in this case, non-MacOSXHints.com) operand characters on compilation.



[ Reply to This | # ]
Add step forward/backward feature to QuickTime Player
Authored by: adrianm on Nov 12, '05 12:33:32AM
I presume also you can put said scripts in ~/Library/Scripts/Applications/Quicktime Player and assign a keystroke to the the script menu that appears when Quicktime player is active?

Although the Salling Clicker idea that someone mentioned seems like a very good idea to me.

[ Reply to This | # ]

Add step forward/backward feature to QuickTime Player
Authored by: lucite on Nov 13, '05 04:31:21PM

How do you assign a keystroke to a script?



[ Reply to This | # ]
Add step forward/backward feature to QuickTime Player
Authored by: adrianm on Nov 14, '05 02:55:02AM

The script appears in the global script menu.
Keystrokes are assigned in System Preferences, IIRC.
(I don't use it much myself)



[ Reply to This | # ]
Add step forward/backward feature to QuickTime Player
Authored by: adrianm on Nov 15, '05 04:09:01AM

My mistake. System-wide keyboard shortcuts have no effect on the Script menu :-(

Shame.



[ Reply to This | # ]
Add step forward/backward feature to QuickTime Player
Authored by: thevil on Nov 13, '05 12:26:26PM

What's wrong with the slider (cmd-K)?



[ Reply to This | # ]
Scrollwheel
Authored by: clindberg on Nov 20, '05 05:49:25PM

I recently discovered (not sure if it is well known or not) that if your mouse has a scroll wheel, you can use that to step forward/back in Quicktime Player. Just using the scroll wheel with the mouse over the video area pauses the video and starts stepping forward/back.



[ Reply to This | # ]
Add step forward/backward feature to QuickTime Player
Authored by: Gex2501 on Dec 21, '05 03:29:53PM

Does anyone know how to impliment these scripts using Quicksilver? I know you can create triggers, but they are system wide, I'd like to make them specific to Quicktime player. Any thoughts?



[ Reply to This | # ]
Add step forward/backward feature to QuickTime Player
Authored by: richardl on Aug 30, '09 09:39:19PM

This hint stopped working with Quicktime X on Mac 10.6 .. Anyone have any ideas?



[ Reply to This | # ]
Add step forward/backward feature to QuickTime Player
Authored by: fortybillion on Sep 28, '09 09:38:36AM
Got this working in Quicktime Player X by changing (step * (time scale of front movie)) to just step

[ Reply to This | # ]
Add step forward/backward feature to QuickTime Player
Authored by: tiptongrange on Oct 11, '09 04:02:37PM

In addition to your "step" hint, I had to change "front movie" to "front document". This occurs 5 times in the forward script and twice in the backward script.



[ Reply to This | # ]
Add step forward/backward feature to QuickTime Player
Authored by: nick_harambee on Aug 16, '10 09:17:41AM

I have this script working in both Quicktime X and Quicktime 7, making the adjustments recommended here for Quicktime X, but am finding that sometimes the script (which I have assigned to a hotkey) pauses Quicktime X when the hotkey is pressed, instead of continuing to play (the playhead does go back 10 seconds though) and wonder if anyone else is experiencing this, and if there is anything that can be done. Using terminal I have set Quicktime X to play files automatically. I am not sure if this is relevant to this issue.

Nick



[ Reply to This | # ]
Add step forward/backward feature to QuickTime Player
Authored by: harywilke on Nov 04, '10 06:27:15AM
i had the same issue. inserting: play front document as the line before the end tell line solved it for me.

[ Reply to This | # ]
Here's a fix for that
Authored by: PopMcGee on Jan 05, '11 04:58:16AM
harywilke's suggestion actually prevents the feature where you can jump trough the movie in pause mode and it stays in pause mode. To get all the fixes for QuickTime Player X and none of the issues, use this:
property step : 10
tell application "QuickTime Player"
	set playerPosition to (current time of front document) + step
	set movieDuration to duration of front document
	if (playerPosition > movieDuration) then
		if front document is playing then
			stop front document
		end if
		set playerPosition to movieDuration
	end if
	if front document is playing then
		set current time of front document to playerPosition
		play front document
	else
		set current time of front document to playerPosition
	end if
end tell
Cheers!

[ Reply to This | # ]
Add step forward/backward feature to QuickTime Player
Authored by: PopMcGee on Jan 05, '11 05:12:33AM
...and here's the code for properly working backwards-jumping in QT player X:
property step : 10
tell application "QuickTime Player"
	set playerPosition to (current time of front document) - step
	if (playerPosition < 0) then
		set playerPosition to 0
	end if
	if front document is playing then
		set current time of front document to playerPosition
		play front document
	else
		set current time of front document to playerPosition
	end if
end tell


[ Reply to This | # ]
Add step forward/backward feature to QuickTime Player
Authored by: xhinter on Apr 05, '13 08:46:55AM

I use the following scripts in QT 10.2 & OS X 10.8.3

Step forward

property step : 3
tell application "QuickTime Player"
	if front document exists then
		if ((current time of front document) + step) ≤ (duration of front document) then
			set (current time of front document) to ((current time of front document) + step)
		else
			set (current time of front document) to (duration of front document)
		end if
	end if
end tell

Step backward

property step : 3
tell application "QuickTime Player"
	if front document exists then
		if ((current time of front document) - step) ≥ 0 then
			set (current time of front document) to ((current time of front document) - step)
		else
			set (current time of front document) to 0
		end if
	end if
end tell



[ Reply to This | # ]