-
-
Save kristi/8234730 to your computer and use it in GitHub Desktop.
set isPlaying flag even if document is not playing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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