How do we tell quicktime to play a video file through SSH? I'd like to type something like:
% osascript play.scpt hello.mov
the quicktime player then will play hello.mov located in the same folder where play.scpt is.
Here is what I have, but it returns
play.scpt: execution error: No user interaction allowed. (-1713)
on run argv
process_item(item 1 of argv)
end run
-- this sub-routine processes files
on process_item(this_item)
try
tell application "QuickTime Player"
launch
activate
stop every document
close every document
open this_item
play document 1
try
repeat
if done of document 1 is true then
exit repeat
else
delay 3
end if
end repeat
close document 1
end try
end tell
return true
on error error_msg number error_num
my toggle_suppress(false)
if error_num is not -128 then
activate
display dialog error_msg buttons {"OK"} default button 1
end if
error number -128
end try
end process_item
It seems the problem is the open command. For some reason it doesn't like a file name. I'm new to Applescript. Any help is appreciated.
% osascript play.scpt hello.mov
the quicktime player then will play hello.mov located in the same folder where play.scpt is.
Here is what I have, but it returns
play.scpt: execution error: No user interaction allowed. (-1713)
on run argv
process_item(item 1 of argv)
end run
-- this sub-routine processes files
on process_item(this_item)
try
tell application "QuickTime Player"
launch
activate
stop every document
close every document
open this_item
play document 1
try
repeat
if done of document 1 is true then
exit repeat
else
delay 3
end if
end repeat
close document 1
end try
end tell
return true
on error error_msg number error_num
my toggle_suppress(false)
if error_num is not -128 then
activate
display dialog error_msg buttons {"OK"} default button 1
end if
error number -128
end try
end process_item
It seems the problem is the open command. For some reason it doesn't like a file name. I'm new to Applescript. Any help is appreciated.