I have made a duplicate of the application "Quicktime player" on my Mac and renamed it "Reaction" then I have put this copy inside of a applescript. I am trying to write a code that tells the "Reaction" to start a "New Movie Recording" (which is a option of recording) then save the recording within the applescript. (the name of the recording is irrelevant)
Extra: Also if anyone knows how I could then code a way to add the recording to a email and send it to people that would be great.
At the moment I know how to open "Reaction" but not how to tell "Reaction" to start a "New Movie Recording"
So far i'm using this to open "Reaction"
set appPath1 to path to resource "Reaction.app"
tell application "Finder"
open appPath1
end tell
Best Answer
Having duplicated your QuickTime Player application and named it Reaction, I understand you've created an AppleScript applet, and placed this copy of Reaction.app within the
Resources
folder of the AppleScript applet.Because it's a duplicate of QuickTime Player (which is scriptable), Reaction is also scriptable, and can also be scripted from within the applet's AppleScript (located at
Resources/scripts/main.scpt
).Your
main.scpt
should look something like this:application "QuickTime Player"
may change of its own accord toapplication "Reaction"
, which is completely fine.This script creates a ~10 second recording, minus a couple of seconds to account for the initialisation of the script and such. Change
delay 10
to whatever value represents a sensible recording time in seconds.To send it as an attachment using Mail:
The top script and the bottom script can simply join to form one continuous script. You might need a delay in between the two portions, but I didn't require one on my system.
However, the delay within the Mail block is important if you wish to send the email (you must also uncomment the
send
command by removing the--
; keeping it in, which I did during testing, will allow you to preview the email and send it manually).