Re: XML data and QT, does it exist?
Re: XML data and QT, does it exist?
- Subject: Re: XML data and QT, does it exist?
- From: Brennan <email@hidden>
- Date: Thu, 26 Feb 2004 10:50:51 +0100
On 26/2/04 at 00:28, Michael Vitti <email@hidden> wrote:
>
Hi, I'm an AppleScript user here in chilly NYC. Had this question
>
posed to me: can one include text data, like XMP files to a QT clip and
>
if it's possible to access this through AS? Saw in the list archives
>
that QT player is scriptable, would the annotation or somehow a text
>
layer (that is off or switchable) might function to hold user
>
searchable text information?
Certainly. This is a really powerful (and underused) feature of QuickTime.
Most people are aware of annotations, which do get used a bit, although
not nearly as much as they might be.
For searchable time-based text though, use a text track. This need not
even be visible. Commonly, people will convert a transcription of a
lecture (or whatever) into a text track, so that people can jump quickly
to the right place. There's a sub-species of text track called a 'chapter
track' which displays its samples as a little popup menu. Both approaches
may be used at once.
Text samples are directly scriptable with QuickTime player.
Creating and editing:
tell application "QuickTime Player"
set m to (make new movie with data "Hello\rWorld")
tell m
tell track 1
tell frame 2
set sample data to "Goodbye"
end tell
end tell
end tell
end tell
(Note: Creating new frames in an *existing* text track seems not to work.
This might be by design, and there are workarounds.)
Once you've got a text track, you can add it to a video or audio track or
whatever using 'Add' or 'Add Scaled' in QuickTime player. (This is also
scriptable).
Another approach is that you can mark up a 'QTtext' file which the
QuickTime importer can read and convert into a text track. Such a file can
(for example) be stored on a web server, and then you can get the
QuickTime browser plugin to create the text track on the fly if you mark
up your HTML properly.
More information on text tracks is available here:
<
http://www.apple.com/quicktime/tools_tips/tutorials/texttracks.html>
Quicktime player offers a 'Find' command in the GUI - which is also
available to the scripting interface - but if you are scripting, and you
know which text track you want to search, you can get more flexible
results with something like
set searchString to "whatever"
tell application "QuickTime Player"
tell movie 1
tell track 1
set f to (frames whose sample data contains searchString)
display dialog searchString & " appears " & (count f) & " times"
end tell
end tell
end tell
The advantage here is that you can get multiple results in one go. 'Find'
will only 'find forwards' or 'find backwards', and will move the playback
head to the next result, which might not be desirable. Your call.
Text tracks are searchable in a small handful of applications which
directly support text tracks. (Sorry, I don't have a complete list).
Even if your playback environment doesn't directly support text track
searching, you can create a little wired sprite widget in LiveStage Pro
which will do a text track search in any QuickTime playback environment -
including the web browser.
If you're really interested in this stuff, take a look at the book
'Quicktime for the Web', and maybe join the Quicktime Talk mailing list.
<
http://www.lists.apple.com/mailman/listinfo/quicktime-talk>
There are often discussions about text tracks, Applescript and other
subjects. There are even political discussions about QuickTime marketing,
MPEG licensing issues, plus debate about media 100 or cleaner and other
important apps whose future is threatened. The Apple engineers dislike -
and often attempt to discourage - the political threads, but they remain
popular, are often interesting and (IMNSHO) relevant to anyone who seeks
to make a living using Quicktime. It would be good to see you there.
Brennan
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.