[ENH] Applescript classes for applications & media players
(quicktime/DVD Player)
John M McIntosh
johnmci at smalltalkconsulting.com
Sat Jun 21 07:22:01 UTC 2003
A week back Alan asked me to create a something to interface to Apple's
DVD Player, so I
thought, Gee isn't there an Applescript interface class in the base
Squeak? Yes there is.
Thus here is a set of classes that allow you to talk to most
Applescript aware applications to
perform hide,show, open file, quit and activate.
For Apple's media players, QuickTime, and DVD player the commands are
more extensive with
the DVD player being fully supported. I've decided to push this out to
the list because I think
with the ability to have a floating Squeak window (in the 3.5.1b4 mac
VM why you could make a really interesting
DVD controller... Or of course add some more subclasses for
interesting macintosh application, and perhaps flesh-out
the quicktime classes.
There is of course a companion SUnit to help one see what the commands
and behaviour should be.
a couple examples.
| player |
player _ ApplescriptAppsPlayerDVD new.
player
show;
goToMainMenu;
hitEnterKey;
wait5Seconds;
playFrom: 4/10 to: 5/10;
waitTilDonePlaying;
quit.
| d |
d _ ApplescriptAppsPlayerDVD new.
d activate;
hideViewer;
volume:0;
goToMainMenu;
hitEnterKey;
chapter: 2;
showViewer;
volume: 1
" In this example beware that Quicktime will also play text files,
flash, and a million media formats,
so yes you can playback smalltalk change files if you want..."
| file player aName squeak |
file _ FileList2 modalFileSelector.
file ifNil: [^self].
aName _ file name.
file close.
player _ ApplescriptAppsPlayerQuickTime new.
squeak _ ApplescriptAppsSqueak new.
player openFile: aName.
player
show;
playFrom: 4/10 to: 5/10;
hideTilDonePlaying: squeak;
quit.
--
========================================================================
===
John M. McIntosh <johnmci at smalltalkconsulting.com> 1-800-477-2659
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
========================================================================
===
-------------- next part --------------
A non-text attachment was scrubbed...
Name: applescriptmovies-JMM.12.cs.gz
Type: application/x-gzip
Size: 9684 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20030621/fcbd8242/applescriptmovies-JMM.12.cs.bin
More information about the Squeak-dev
mailing list
|