Cool CD inserted script for use in Rev

Thomas McGrath III 3mcgrath at adelphia.net
Tue Feb 21 23:49:51 EST 2006


A while back there was discussion on interacting with CDs and I just  
came across part of a solution that I thought was really cool. I  
wanted to share it here.

The scenario is this: Let's say you want to interact with the  
contents of a CD once it is inserted into your Macintosh from with in  
REV. Something like looking up/searching for info online etc. or to  
clean up names etc. But you don't know when a CD will be inserted and  
want to know when it is to process info on it.

Well using the Digital Hub Scripting.osax built into OSX you can  
create an applescript and have it selected in the "CDs & DVDs"  
Preference Pane in the System Preferences. So for music you could in  
the pane select the "When you insert a music CD:" and choose "Run  
script..." and select the script you want. The cool part is that the  
system listens for a CD insertion and then will launch the script  
then do some path collecting maybe and then launch your REV stack to  
process the CD from within REV or your standalone with out it having  
to be open or running. That's cool. This will also work with picture  
CDs and Video DVDs.

The script (not yet finished):

-- in an applescript assigned to the "Run script..." in the "CDs &  
DVDs" preference pane in the "System Preferences" pane.

on music CD appeared this_disk -- this is the really cool part -- it  
is a call to the Digital Hub Scripting.osax
try
	set this_disk to this_disk as string
	set the disk_name to (characters 1 thru -2 of this_disk) as string
	-- do something with music files or folder here
	-- create list etc. in variable

	tell application "Revolution" -- or your standalone
	activate
	-- return variable of list or path to files etc. to REV
	-- or just to launch your stack/standalone and have it then know a  
CD is inserted and do stuff there
	end tell
end try

This seems so simple but I had been wanting to do something like this  
without having my standalone running all of the time in the background.


HTH someone,

Tom




Thomas J McGrath III
3mcgrath at adelphia.net

Lazy River Software™ - http://www.lazyriversoftware.com

Lazy River Metal Art™ - http://www.lazyriversoftware.com/metal.html

Meeting Wear™ - http://www.cafepress.com/meetingwear

Semantic Compaction Systems - http://www.minspeak.com

SCIconics, LLC - http://www.sciconics.com/sciindex.html










More information about the use-livecode mailing list