Apple script + Quicktime for a Newbie
Apple script + Quicktime for a Newbie
- Subject: Apple script + Quicktime for a Newbie
- From: Adrian Legg <email@hidden>
- Date: Mon, 29 Jan 2001 13:52:09 +0000
Hello All,
Newbie Alert!
I have been trying to write a script that imports "ID3v2" tags from MP3
files into QT files annotations section.
I have 500 MP3 files that have the "ID3v2" in place, converted the files
into streaming QT movies. But I need to have the annotations in place.
Someone from the QT list was kind enough to write the script below. It
works well enough, but the final files it saves contain only the annotations
and not the sound track and hinted sound track. Can the script be adjusted
to save as a self contained movie with annotations and sound tracks. Or is
there a script that will merge the annotation QT file with the original
streaming QT file?
As I have never used AS before I am not sure how to do this, and the poor
guy who wrote this has had enough dumb mails from me.
Can anyone help? Please, deadline looming!
Below is the script
Thanks
Adrian Legg.
set e to choose folder
try
tell application "Finder" to make new folder at e with properties
{name:"new"}
end try
tell application "SoundJam MP"
set trackcount to count of tracks in window 1
repeat with x from 1 to trackcount
set thetitle to name of track x in window 1
if thetitle = "" then set thetitle to " "
set theartist to artist of track x in window 1
if theartist = "" then set theartist to " "
set thealbum to album of track x in window 1
if thealbum = "" then set thealbum to " "
set theloc to location of track x in window 1
tell application "Finder"
set thefilename to (name of theloc)
if (characters ((count of characters in thefilename) - 2) thru
((count of characters in thefilename)) of thefilename) as text = "mp3" then
set thefilename to characters 1 thru ((count of characters
in thefilename) - 4) of thefilename as text
end if
if file ((e & thefilename & ".mov") as text) exists then
try
tell application "QuickTime 4.1.2 Player"
activate
open ((e & thefilename & ".mov") as text)
set the full text of annotation "Artist" to theartist
set the full text of annotation "Full Name" to
thetitle
set the full text of annotation "Album" to thealbum
--save movie 1
save movie 1 in (e & "new:" & thefilename & ".mov"
as text) as self contained
end tell
on error errMsg number errNum
display dialog errMsg & " Error #" & errNum buttons
{"OK"} default button 1 with icon 1
end try
else
tell application "QuickTime 4.1.2 Player" to display dialog
"CraP! " & thefilename & ".mov was not found!"
end if
end tell
end repeat
end tell