Hey,
I am having a few issues with a script I'm making. This script will eventually, look into a folder on the server, grab one *.mov file, move it to the local harddrive, open up quicktime, encode the movie with settings from a file, then move the encoded *.mov back into a new folder on the server.
Sounds easy right? lol
I've been getting little bits and pieces down, I don't know perl and applescript well enough to do a decent job, but here is my perl script.
If you can read through the junk, basically the perl script runs, then opens a *.mov file that you specify. Once that is open, perl launches an applescript with RunAppleScript.
It runs now and encodes, but I was wondering if anyone knew how to take an argument from perl and put it into the applescript.
For example: I type: "./VODDuex.pl mymovie.mov
Then it runs, and instead of applescript creating the "movie.mov" file in the /, I can pass another argument like "./VODDuex.pl mymovie.mov finished.mov" and the script will run and create finished.mov as the final encoded movie.
I have been workin on and off of this problem for a while now, I must not know the right keywords to tell google, lol.
Any questions, ask away.
Thanks,
I am having a few issues with a script I'm making. This script will eventually, look into a folder on the server, grab one *.mov file, move it to the local harddrive, open up quicktime, encode the movie with settings from a file, then move the encoded *.mov back into a new folder on the server.
Sounds easy right? lol
I've been getting little bits and pieces down, I don't know perl and applescript well enough to do a decent job, but here is my perl script.
Code:
#!/usr/bin/perl -w
use Mac::AppleScript 'RunAppleScript';
my $source = $ARGV[0];
my @cmd = ("open", "$source");
system(@cmd) == 0
or die "System @cmd failed: $?";
# The Applescript that opens Quicktime to encode the movie in $ARGV[0]
# Throw it all into the $script variable
my $script =<<END;
tell application "QuickTime Player"
with timeout of (86400 * 2) seconds
if not (exists movie 1) then error "No movie file open."
if not (can export movie 1 as QuickTime movie) then error "Can't export movie."
export movie 1 to "movie.mov" as QuickTime movie using settings "VODSettings" with replacing
close movie 1
quit saving no
end timeout
end tell
END
RunAppleScript($script) or die "Did not work";
exit(0);
If you can read through the junk, basically the perl script runs, then opens a *.mov file that you specify. Once that is open, perl launches an applescript with RunAppleScript.
It runs now and encodes, but I was wondering if anyone knew how to take an argument from perl and put it into the applescript.
For example: I type: "./VODDuex.pl mymovie.mov
Then it runs, and instead of applescript creating the "movie.mov" file in the /, I can pass another argument like "./VODDuex.pl mymovie.mov finished.mov" and the script will run and create finished.mov as the final encoded movie.
I have been workin on and off of this problem for a while now, I must not know the right keywords to tell google, lol.
Any questions, ask away.
Thanks,