Mac Applescript, how to start Camtasia on an sub-monitor

  • 1
  • Question
  • Updated 1 year ago
Hi I am using trial-ing Camtasia 3 for Mac, as I need to capture Webcast Lectures while I am at work. I have been using an Apple script to start and stop Camtasia 3. I am using the following AppleScript syntax:



tell application "Camtasia 3" startRecording region {0, 0, 1600, 1200} delay 120 stopRecording end tell
While this syntax works fine, focuses Camtasia to the main display. Can anyone help with a region setting that focuses on display 2? Changing {0,0 .... to {1,0..... or {1,1... or {0,1.... has not effect of the application starting and drawing a region to the main display
Photo of Duncan Gardiner

Duncan Gardiner

  • 3 Posts
  • 0 Reply Likes

Posted 1 year ago

  • 1
Photo of Stephen Wagner

Stephen Wagner, Employee

  • 610 Posts
  • 149 Reply Likes
It depends on how big your first monitor is, and on how your monitors are arranged.  The { 0, 0 } is the origin of the region.  If your second monitor is to the right of your first monitor, and your first monitor is 1440 pixels wide, then the upper left corner of your second monitor is { 1440, 0 }.  

Off the top of my head I do not know if there is a way for AppleScript to get that information directly from the system, but you should be able to figure it out with some trial and error.

-Stephen
Photo of Duncan Gardiner

Duncan Gardiner

  • 3 Posts
  • 0 Reply Likes
Thanks Stephen I'll have a play.

I have two monitors. The main display is my 13'' laptop screen that is 1300 x 800 pixels, and my second monitor is a lcd that is 1900 x 1100 pixels.

The second monitor sits above my laptop display, so the orientation in up and down not horizontally next to one another.

If I understand your suggestion, my syntax should look something like: region {0,1300,1900,1100}, or possibly: region {0,3200,1900,1100} which is adding the height of the two monitors display pixels to get the starting point in the upper left corner of display 2.

If I get it to work I'll confirm.

Kind regards

Duncan
Photo of Paul Middlin

Paul Middlin, Employee

  • 835 Posts
  • 185 Reply Likes
Just wanted to jump in and say that if your second monitor is *above* your first one, then you probably need to go negative. I think the coordinates in your case would be {0, -1100, 1900, 1100}. That could still, potentially, be a little off if your monitors are not aligned on the left side. Good luck!
Photo of Duncan Gardiner

Duncan Gardiner

  • 3 Posts
  • 0 Reply Likes
Paul you are correct the negative setting works a treat. so I am using "region {0, -1900, 1900, 1100}" to get the Camtasia region to the correct position to record.

What was interesting in my testing, is that if you set the start point of the region to an area that is on neither screen (in space not a physical device) eg "region {0, 3200, 1900, 1100}" in my case, Camtasia crashes the Mac and it logs out to the sign in screen.

I have never seen an app do that before. I am hoping that is a bug, we found and the Tech team will address it.

Thanks Paul you got me to the point I need faster than working it out on my own.

Duncan
Photo of Paul Middlin

Paul Middlin, Employee

  • 835 Posts
  • 185 Reply Likes
Yikes, we'll have to watch out for that. Generally, our scripting support is... not entirely supported. It's more like something loosely hacked in there to help out the hardcore, but not something many people take advantage of. It's not really an official feature :) So thanks for finding that bug!