I use Camtasia 2 on Mac for all my screencasting, and while I generally find it a great piece of software, the lack of batch exporting can be extremely frustrating.
So I’ve made an AppleScript which does the job. You can download it here, or if you’re familiar with the OSX Script Editor, just copy and paste the code below into it. You’ll need to give it the appropriate permissions - instructions for that are in this video:
AppleScript Code:
set projDir to choose folder with prompt “Choose a folder with .cmproj files in it” without invisibles
set myDirectory to POSIX path of projDir
tell application “Finder”
set fl to files of alias (projDir as text)
end tell
repeat with f in fl
set n to name of f
if n ends with “.cmproj” then
set offs to offset of “.cmproj” in n
set exportName to (text 1 through offs of n) & “mp4”
tell application “Camtasia 2”
open f
repeat
delay 1
if number of documents > 0 then
if name of first document = n then
exit repeat
end if
end if
end repeat
end tell
tell application “System Events” to tell process “Camtasia 2”
#click menu item “Export…” of menu “Share” of menu bar item “Share” of menu bar 1
repeat
key code 14 using {command down}
delay 0.5
try
tell window n to click button “Export” of sheet 1
exit repeat
end try
# 1 - none; 2 - axraise; 3 - window menu
tell window n to perform action “AXRaise”
#click menu item n of menu “Window” of menu bar item “Window” of menu bar 1
delay 0.1
end repeat
repeat
try
static text “Export finished” of sheet 1 of window n
tell window n to click button “Close” of sheet 1
exit repeat
end try
delay 2
end repeat
end tell
(*
tell project of first document
export file myDirectory & “/” & exportName
repeat
set shouldExit to not isExporting
if shouldExit then exit repeat
delay 2
end repeat
end tell
*)
tell application “Camtasia 2”
close every document without saving
end tell
end if
end repeat
Recent Comments