Created
February 6, 2015 22:07
-
-
Save troygrosfield/713021a6f320bfcb794c to your computer and use it in GitHub Desktop.
Create empty audio files using applescript
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
global duration | |
set duration to 43 | |
set endDuration to 46 | |
repeat until duration = endDuration | |
set recordName to "empty-" & duration & "sec.m4a" | |
set newPath to "~/Users/troy/Desktop/audios/" & recordName | |
set duration2 to duration | |
tell application "Finder" | |
set savePath to (path to desktop as text) & recordName | |
tell application "QuickTime Player" | |
activate | |
set doku to new audio recording | |
start doku | |
repeat until duration2 = 0 | |
delay 1 | |
set duration2 to (duration2 - 1) | |
end repeat | |
delay 0.03 | |
#delay duration | |
stop doku | |
set newDoc to last item of (documents whose name contains "Untitled") | |
export newDoc in file savePath using settings preset "Audio Only" | |
#close every document without saving | |
end tell | |
end tell | |
#move file savePath to file newPath with replacing | |
set duration to (duration + 1) | |
end repeat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment