Q: How to select a camera for Quicktime in Applescript?
ElCap 10.11.5 (15F34)
I'm trying to automate a screen recording of one of several iPhones we're running tests on in parallel (using several robot users on the same machine).
Since Quicktime sadly only supports one user recording at a time (even if I start a Desktop for each), I have to tell it to record the iPhone allocated to the user with the desktop, but I'm struggling with that:
tell application "QuickTime Player"
repeat with i from 1 to (get video recording devices count)
set d to (get video recording device i)
set n to (get name of d)
# Doesn't get this far.
# if item 1 of argv is equal to n then
# tell recording to set current camera to d
# end if
end repeat
end tell
The error is
QuickTime Player got an error: Can’t make screen compression preset "[A][LON] 670-53 81:ie iPhone 5c 8Gb Blue" into type specifier.
....which is really annoying, dangling the very information I want right in front of me. I'm tempted to rig something involving capturing and parsing the error message, but that would be evil. I find it really hard to code in languages that hide or obscure their type information, but expect you to know what's going on.
'Script Debugger' says the offending AEPrint looks like this, in case it helps:
'obj '{
'form':'name',
'want':',
'seld':'utxt'("[A][LON] 670-53 81:ie iPhone 5c 8Gb Blue"),
'from':[
0x0,
ab0ab "QuickTime Player"
]
}
Firstly, what magical incantation should I be using for this?
Secondly, why isn't what seems like the obvious thing to do, working?
Thanks.
Posted on Jun 28, 2016 3:29 PM