Skip to content

Instantly share code, notes, and snippets.

@mbrgm
Created April 3, 2015 10:28
Show Gist options
  • Save mbrgm/c90b2e101167440295c2 to your computer and use it in GitHub Desktop.
Save mbrgm/c90b2e101167440295c2 to your computer and use it in GitHub Desktop.
AppleScript for semi-automated capturing of DV tapes to disk
-- You need the applications `AVCVideoCap.app` and `AVCBrowser.app` from the Mac
-- OS X Firewire SDK (from https://developer.apple.com/downloads/index.action#)
-- and an application for playing sounds (if you want to have an audible
-- notification when capturing is complete), e.g. `Play Sound.app` from
-- http://www.macupdate.com/app/mac/8479/play-sound. Feel free to adjust the
-- script as needed.
--
-- Tested on Mac OS X Mavericks (10.9).
--
set finished to false
repeat while not finished
display dialog "Kassettennummer eingeben:" default answer ""
set tapeNo to (text returned of result)
tell application "AVCVideoCap.app" to quit
tell application "AVCVideoCap.app" to activate
tell application "System Events" to tell process "AVCVideoCap"
tell application "AVCVideoCap.app" to activate
set mainWindow to front window
tell mainWindow
select row 1 of table 1 of scroll area 1
click button "Capture From Device"
delay 1
end tell
tell window "Select DV Capture File"
keystroke tapeNo
click button "Save"
end tell
tell mainWindow
click pop up button 1 of sheet 1
click menu item "Tape Control" of menu of pop up button 1 of sheet 1
click button "Continue" of sheet 1
end tell
repeat while not (exists static text "Capture complete" of mainWindow)
delay 1
end repeat
end tell
tell application "AVCVideoCap.app" to quit
tell application "AVCBrowser.app" to activate
tell application "System Events" to tell process "AVCBrowser"
click button "Open Device-Control Panel" of window "AVCBrowser - Version 2.2"
tell front window
click button "Open Device"
tell tab group 1
click radio button "Tape"
set theCheckbox to checkbox 2 of group "Tape Subunit Status"
tell theCheckbox
if not (its value as boolean) then click theCheckbox
end tell
set thePopup to pop up button 3 of group "Specific Transport Modes"
click thePopup
click menu item "Rewind (0x65)" of menu of thePopup
click button "Wind" of group "Specific Transport Modes"
delay 2
set finishedRewinding to false
repeat while not finishedRewinding
set transportState to value of static text 1 of group "Tape Subunit Status"
if (transportState is "Stop") then
set finishedRewinding to true
end if
delay 1
end repeat
end tell
click button "Close Device"
end tell
end tell
tell application "AVCBrowser.app" to quit
tell application "Play Sound" to play "Macintosh HD:System:Library:Sounds:Glass.aiff" repeat 4
display dialog "Übertragung abgeschlossen. Bitte Kassette entnehmen!"
display dialog "Weitere Kassette übertragen?" buttons {"Ja", "Nein"} default button 1
if result = {button returned:"Ja"} then
display dialog "Bitte nächste Kassette einlegen!"
else
set finished to true
end if
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment