I need to be able to have Director open up the windows Notepad so the user can take notes while studying from the CD-ROM.

I already have a button in director tiled "Notepad".  I need the script and any additional info so I can have the user click on the notepad button and have it open up notepad so they can take notes.  Once they are done taking notes in notepad and they have saved it to a location on their PC, I need for that same file to be opened back up if they click on the notepad button again.  I am re-creating an interactive CD-ROM and the way they have this set up is with one button.  When there is no saved notepad text file, the button opens up a blank notepad text file.  When the user saves the notepad text file, that very same button opens that text file again instead of a new notepad text file.
kishfyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MediaMacrosCommented:
Buddy API will be easiest (www.mods.com.au or www.mediamacros.net/customer)

Just use baOpenFile with the name of the file to open wit the default editor...

baOpenFile("c:\file.txt", "normal")

If you want to make a new file use file IO...

myFile = xtra( "fileio")new()            
createFile( myfile, "c:\file.txt")
myFIle = void

THen open it...

baOpenFile("c:\file.txt", "normal")
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MediaMacrosCommented:
Oh, you can also use baFileExists() to see if the file exists before creating a new one.  You can additionally use File Xtra 3 or 4 to do the same type of opperation.
0
kishfyAuthor Commented:
OK, this makes no sense to me, as I am a beginner.  I tried this script on the button under the "on mouseUp me" section and nothing works.  Here is the deal, I have a button with absolutely no script on it.  What exactly do I need to put as the script?  I need to have this button open up notepad, then I need this same button to be able to open up the file I created with notepad when pressed again.  

I dont understand what ( ) means or what is supposed to go inside these brackets in your example.  Is there a place where I can download an example .dir file to look at the code and how this is done?
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

LingoMasterCommented:
 Your objective is a bit on the advanced side, I suspect some compromise, either a great simplification, or some serious code sikill advancement would be needed.

 Director's built in Open commnd which can open a file with an application when given the exact path to both is only suitable for applications, like kiosks, where you have total control over the system configuration.
  For projects distributed on a Cd, where you don't  know the drive letter it's running off and can't guarantee what editors are installed, or where they are located, you have to be a bit more tricky.
  The buddyAPI Xtra is a 3rd party add-on, they have a tiered pricing scheme allowing a project using only 2 of it''s functions for free.
  The baOpenFile("c:\file.txt", "normal")
   example cited earlier had the smarts to loolkup the program registered to open a .text file, te same as double clicking it in the file manager does.  This default application setup by the user may well be something other than notepad.
  If you can deal with various end user editors being used, the code would just hae to be refined perhaps to open a file from the projector's volume
    The baOpenFile(the pathName & "someDoc.txt", "normal")  will open the someDoc.txt file located in the same folder as the director file.

  Unless the user is given strict instructions, the name and the location of the file they saved in notepad may be unknown, this is probably the most dificult part of whar you are attempting, I have not heard of one being able to read the 'recent documents' record that may be kept for notepad.

If the document is kept simple (probably so if notepad is involved)  you may well be able to simulate an editor inside of director, using the fileIO xtra to open and save the text files, having Director in charge of file saves may be the only way you can keep a record of the user's activity, specificly where and what name a file gets saved under.  Xtras, like fileIO have a language of their own and are not all that easy to program.

Here's a lnk to a introductory article on the FileIO xtra, with example code to save a field to a text file.

http://www.macromedia.com/support/director/ts/documents/tn3192.html



Here's an article (with source code) showing the code involved in simulating a spreadsheet application, this may give you the feel for the complexity of programming you would be facing.

http://director-online.com/buildArticle.php?id=883
0
MediaMacrosCommented:
The code I supplied was an example.  You will need to sub my path for hte actual path to your file.  If its relative to teh movie then you need to use the lingo...
the moviePath
to find the file.  For example, to load a file named "file.txt" in the same folder as the movie use...

baOpenFile(the moviePath & "file.txt", "normal")
0
kishfyAuthor Commented:
WOW, I thank you for this elaberate information.  This is a great site!  I am going to try to put this info to use!  I'll close this question and post my comments by weeks end!
0
kishfyAuthor Commented:
OK, I was able to make director create a file called Notes.txt at this location C:\Notes.txt  I was also able to make director open that very same file with the same button immediately after the lingo created the text file.  If the user types date into the text file and saves it, when I use this button again, it opens the text file and all of the user date is still there.  This is great and exactly what I want, but here is the glitch.  This only works when I am playing the movie in director.  I have no problems and the button does exactly what I need it to do.  The problem is after creating a projector and then run the project from the projector.  When I use the button from the projector, I get a prompt saying "Script Error"  Why is it that I can have my button create a new text file then open the text file with the default editor using File I/O and playing the project within Director but the same button does not function from the projector.  I have included the File I/O extra in the projector as well as the baOpen xtra.  Here is the script I used on the button to make it work within Director.

on mouseUp me
  myFile = new(xtra "fileio")            
  createFile(myfile, "c:\notes.txt")
  myFIle = void
  baOpenFile("c:\notes.txt", "normal")
end

Do I need to create this text file in a place other than C:\, is this my problem?  I will be running this project off of a CD-ROM so I cant have the text file in the director project directory because the user will not be able to write to the CD.

Kevin

0
MediaMacrosCommented:
Buddy API can also find user folders...

iFOlder = baSysFolder("desktop")
or
iFolder = baSysFolder("documents")
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.