Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Copy and Paste inside non-editable fields
Creating a Marquee Tool
Display an objects properties in Director
Convert between bases-Integer to String
Hyper Midi
ADisplay
Quick mouseover
Find CD Drive Letter
TransMac
UltimateFileIO
 

 

 

Behavior Import Save File From Command Line

Added on 12/19/1999

 

Compatibilities:
D7 D8 Mac PC Script Shockwave

Rating:

Author: MediaMacros (website)

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

Send e-mail