Last active
August 2, 2017 03:06
-
-
Save eseiver/ad535c58c8356d3bfb5ae5264c021205 to your computer and use it in GitHub Desktop.
An applescript that returns the timecode position of the current iTunes track. Handy if transcribing or taking notes on an audio file!
This file contains 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
tell application "iTunes" | |
set elapsed_seconds to player position | |
set this_elapsed_minutes to round elapsed_seconds / 60 rounding down | |
set N to result | |
if N < 10 then | |
set N to 0 & N | |
end if | |
set this_elapsed_seconds to elapsed_seconds mod 60 | |
if {1, 2, 3, 4, 5, 6, 7, 8, 9, 0} contains this_elapsed_seconds then | |
set this_elapsed_seconds to "0" & (this_elapsed_seconds as string) | |
end if | |
set this_elapsed_hours to round elapsed_seconds / 3600 rounding down | |
set this_elapsed_seconds2 to round (this_elapsed_seconds) | |
end tell | |
return ("### 0" & this_elapsed_hours & ":" & N & ":" & this_elapsed_seconds2) as text -- | |
set the clipboard to result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment