Re: Copy paste in quicktime player.
Re: Copy paste in quicktime player.
- Subject: Re: Copy paste in quicktime player.
- From: Mr Tea <email@hidden>
- Date: Tue, 01 Feb 2005 02:30:10 +0000
Title: Re: Copy paste in quicktime player.
This from TJ Marbois - dated 31/1/05 11·39 pm:
I output the spoken text using this:
on makeAiff(x)
set the target_file to ((myFolder as text) & "VOCODED_OUTPUT:" & x & ".aiff")
say x using "Victoria" saving to target_file
end makeAiff
Now Id like to grab that file and open it via Quicktime player and concatenate another file to the end <snip> the problem seems to be that it happens to fast...Speech hasn't yet output the file...like it needs a bit o delay.
Not on my wheezing G4/867 it doesn’t. Even when the speech being saved to file is quite long (see below), it opens almost instantly in QT player... but this only happens OMM if the folder into which the file must be saved already exists. If the folder “VOCODED_OUTPUT” does not exist, the makeAiff() handler fails silently without producing the required audio file, or generating an error message. When the folder does exist, the following script works fine (provided the file “this one.aiff” and the folder “VOCODED_OUTPUT” are already in place...
global myFolder
global target_file
set myFolder to path to documents folder from user domain
set x to "This unwieldy chunk of text is going to be appended to the front of"
set myFile to (myFolder as text) & "this one.aiff"
makeAiff(x)
tell application "QuickTime Player"
activate
open file target_file
select all
copy movie (name of window 1)
close window 1
open file myFile
paste movie (name of window 1)
export movie (name of window 1) to ((myFolder as text) & "VOCODED_OUTPUT:" & x & " Processed.aiff") as AIFF
close window 1 saving no
end tell
on makeAiff(x)
set the target_file to ((myFolder as text) & "VOCODED_OUTPUT:" & x & ".aiff")
say x using "Victoria" saving to file target_file
end makeAiff
I’ve done hardly any scripting of QuickTime, and I dare say that part of the script could be rendered more elegantly. It’s simply the first thing that worked. :-)
If you still need a delay, simply add the line ‘delay 1’ to the end of the makeAiff handler to create a one second delay before the script moves on – or substitute a smaller or larger number for the delay as required.
Nick
pp Mr Tea
--
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden