Skip to main content

⚠️ Please note that this topic or post has been archived. The information contained here may no longer be accurate or up-to-date. ⚠️

Scripting a Capture from an external source

Comments

5 comments

  • matthewwachter
    Just wanted to share the Python keyboard module solution here.

    import keyboard

    keyboard.press_and_release('ctrl+k')


    Pretty simple but still not ideal. Anyone have any suggestions?
    0
  • Jim_DK
    Hello,

    This problem/solution assumes the camera is always on and tethered to a Mac?
    0
  • matthewwachter
    Yes, this would assume the camera is on and tethered but not specifically to a Mac. I understand that the Scripting category is for Apple users but it seems like this functionality should be os agnostic. The python code I posted would definitely work across platforms.
    0
  • Eric Valk
    You can simulate a keypress in Applescript like this

    tell application "TextEdit" to activate
    tell application "System Events"
    keystroke "abc 123"
    end tell
    More references on this



    However Applescript doesn't have a direct interface to the Mac's Network Interfaces.

    From another Mac you could trigger the Keypress Applescript to run, like this


    There seem to be few OSC applications for OSX, and I don't see one that can trigger ascript of anykind.
    You could log into the Mac using SSH, and the remotely run a keypress script. A bit too low level for this solution I think.

    Otherwise you need something with a network interface that can
    • Call an Applescript Script when it receives a TCP message (receiver side)
    • Send a TCP message in response to a mouse click or keypress (controller side)


    There is a page here with some comments on writing a UNIX script which reacts to a TCP message and could call an Applescript
    0
  • Rick Allen
    There are a lot of 'you could' answers but without knowing a little more about what you are hoping to achieve it not necessarily what you should do.

    for instance AS has a direct connection to capturing with CO.


    tell application "Capture One 12"
    capture
    delay 1 -- wait for capture to finish
    end tell


    But running AS remotely is a PITA in 10.14 because of the security changes of recent.

    Have you had a look at PiCameraControl there are a couple Pi camera control projects that might be worth looking at.
    0

Post is closed for comments.