home *** CD-ROM | disk | FTP | other *** search
/ ftp.novell.com / 2014.06.ftp.novell.com.tar / ftp.novell.com / forge / camtasia.msi / Cabs.w1.cab / autocam.bat32 < prev    next >
Text File  |  2009-08-19  |  3KB  |  78 lines

  1. @echo off
  2. REM autocam.bat
  3. REM
  4. REM Example batch file for simple Camtasia Recorder automation.
  5. REM TechSmith Corporation 10/11/02
  6. REM
  7. REM The following Camtasia Recorder command line options allow you to automate/control
  8. REM Recorder very simply from other applications or a batch file.
  9. REM /r - starts/resumes recording using the current Recorder settings
  10. REM      This option fails if Recorder is already recording
  11. REM /p - pause recording
  12. REM      This option fails if Recorder is not running, or if Recorder is not recording
  13. REM /s - stop recording
  14. REM      This option fails if Recorder is not running, or if Recorder is not recording/paused
  15. REM /h - run hidden (hides the Recorder User Interface and disables the hide/unhide tray icon hotkey)
  16. REM      This option always succeeds
  17. REM /x - causes the running instance of Recorder to exit
  18. REM      This option fails if Recorder is not running.  If a recording session is active, the /x option
  19. REM      aborts the capture and discards any video file.  Note that you can safely perform a /s to stop
  20. REM      recording followed by a /x to cause Recorder to exit (e.g. CamRecorder.exe /s/x).
  21. REM 
  22. REM When the command line options are used, Recorder exits with a exit code of 0 on success and 1 on
  23. REM any failure.  The exit code is reflected as the "errorlevel" in DOS batch files.
  24. REM
  25. REM NOTES:
  26. REM - The current Recorder settings are used during command line automation.
  27. REM - Disable the "pause before starting capture" option in Recorder (Options->Preferences->Program).
  28. REM - To run unattended, configure Recorder to save to a fixed or automatic file name (see Options->Preferences->File).
  29. REM - The "ping 127.0.0.1" command used in this batch file is simply an easy way to pause for a while.
  30. REM   A better method would be to use sleep.exe from the Windows Resource Kit.
  31.  
  32. REM Startup an instance of Recorder.
  33. start CamRecorder.exe
  34. echo Starting up Recorder...
  35. REM Wait for Recorder to startup.
  36. ping 127.0.0.1 -w 10 -n 5 > NUL
  37.  
  38. REM Start recording.
  39. CamRecorder.exe /r
  40. if errorlevel 1 goto COMMAND_FAILED
  41. echo Start recording...
  42. REM Record for a while...
  43. ping 127.0.0.1 -w 10 -n 5 > NUL
  44.  
  45. REM Pause.
  46. CamRecorder.exe /p
  47. if errorlevel 1 goto PAUSE_FAILED
  48. goto PAUSE_SUCCESS
  49.  
  50. :PAUSE_FAILED
  51. REM Pause failed, maybe "pause before starting capture" is enabled.
  52. echo Pause failed, please disable "pause before starting capture" in Recorder.
  53. goto COMMAND_FAILED
  54.  
  55. :PAUSE_SUCCESS
  56. echo Pause for a while...
  57. REM Pause for a while...
  58. ping 127.0.0.1 -w 10 -n 5 > NUL
  59.  
  60. REM Start recording again.
  61. CamRecorder.exe /r
  62. if errorlevel 1 goto COMMAND_FAILED
  63. echo Start recording again...
  64. REM Record for a while...
  65. ping 127.0.0.1 -w 10 -n 5 > NUL
  66.  
  67. REM Tell Recorder to stop recording, save the movie, then exit.
  68. start CamRecorder.exe /s /x
  69. echo Stop recording, save the movie, then exit...
  70. goto END
  71.  
  72. :COMMAND_FAILED
  73. echo Command line option failed.
  74. REM Tell the running instance of Recorder to exit.
  75. CamRecorder.exe /x
  76.  
  77. :END
  78.