I am trying to start and hide quicktime player, start recording my iPhone screen for some duration and save the output on the desktop with file name "hello" with the below script
on run
set filePath to (path to desktop as text) & "hello.mov"
set f to a reference to file filePath
startVideoRecording(f)
end run
on startVideoRecording(f)
tell application "QuickTime Player"
activate
tell application "System Events"
keystroke "h" using command down
end tell
set newMovieRecording to new movie recording
set camera to "Prabhu Konchada's iPhone"
tell newMovieRecording
set camera to "Prabhu Konchada's iPhone"
start
end tell
delay (10)
pause
save newMovieRecording in f
stop
close newMovieRecording
end tell
end startVideoRecording
To hide quicktime player I tried :
- tell application "System Events" to tell process "QuickTime Player" to keystroke "h" using command down.
tell application "Finder" set visible of process "QuickTime Player" to false end tell
tell application "System Events" set frontProcess to first process whose frontmost is true set visible of frontProcess to false end tell
The above 3 methods didn't serve my purpose and I don't want this quicktime all over my screen or visible in my DOCK ...