This script will import a file that is dragged onto the projector"s icon using the command line args.
--Copyright 1999 Chuck Neal
--chuck@mediamacros.com
--If you find this code helpful, send me an e-mail and let me know. :-)
on checkString me
acceptedTypes = ["txt", "doc"]
theFile = the commandLine
theChars = theFile.char.count
if theFile <> "" and acceptedTypes.getOne(theFile.char[(theChars - 2)..theChars]) <> 0 then
--is a valid file dropped or clicked
myFile = new(xtra "fileIO")
openFile(myFile, theFile, 1)
theText = readFile(myFile)
closeFile(myFile)
return theText
end if
end
on getBehaviorDescription me
return "Call this handler to return the text of a file that started your projector. Change the acceptedTypes list to the extensions you want to use. For more advanced use you can use the file association script in the commercial Buddy API library to allow saved files to be double clicked and start automatically."
end
Contact
MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA