Skip to content

Instantly share code, notes, and snippets.

@nicwolff
Created July 24, 2013 00:13
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save nicwolff/6067187 to your computer and use it in GitHub Desktop.
Save nicwolff/6067187 to your computer and use it in GitHub Desktop.
AppleScripts to skip forward 30 seconds or back 10 seconds in either VLC or QuickTime Player
if application "VLC" is running then
tell application "VLC"
step backward
end tell
end if
property step : 10
if application "QuickTime Player" is running then
tell application "QuickTime Player"
set playerPosition to (current time of front document) - step
set movieDuration to duration of front document
if (front document is playing) then
set isPlaying to true
end if
if (playerPosition ≥ movieDuration) then
if front document is playing then
stop front document
end if
set playerPosition to movieDuration
set current time of front document to playerPosition
else
set current time of front document to playerPosition
if (isPlaying) then
play front document
end if
end if
end tell
end if
if application "VLC" is running then
tell application "VLC"
step forward
step forward
step forward
end tell
end if
property step : 30
if application "QuickTime Player" is running then
tell application "QuickTime Player"
set playerPosition to (current time of front document) + step
set movieDuration to duration of front document
if (front document is playing) then
set isPlaying to true
end if
if (playerPosition ≥ movieDuration) then
if front document is playing then
stop front document
end if
set playerPosition to movieDuration
set current time of front document to playerPosition
else
set current time of front document to playerPosition
if (isPlaying) then
play front document
end if
end if
end tell
end if
@okaypol
Copy link

okaypol commented Apr 17, 2016

tell application "VLC"
set current time to current time - 5
end tell

@Hoasd
Copy link

Hoasd commented Jul 25, 2019

@nicwolff: Very usefull scripts. Thank you for providing it!

@francesco-plt
Copy link

Hi! Thanks for providing the script, it looks exactly like what I need. Since I'm new to AppleScript, can you explain how could I use it? Ideally I would like to use arrow keys to go forward/backward of 10 seconds while playing videos in Quicktime Player.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment