Skip to content

Instantly share code, notes, and snippets.

@kristi
Forked from nicwolff/back 10 seconds
Last active January 2, 2016 02:09
Show Gist options
  • Save kristi/8234730 to your computer and use it in GitHub Desktop.
Save kristi/8234730 to your computer and use it in GitHub Desktop.
set isPlaying flag even if document is not playing
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
set isPlaying to (front document is playing)
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
set isPlaying to (front document is playing)
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment