Help me with my project

How does I make a list of the content of different text feilds?

Im including the project file if you want to take a look, I made a comment at the top about my problem. You can just post the changes I should do here.

My project

There is a language barrier here but I think what you are trying to do is build some sort of vocabulary quiz. The first screen allows you to enter a Swedish word and its equivalent French word. The next screen presents the French word and asks for the Swedish equivalent, and tells you if you are right or wrong based on the first input screen. I believe you want to build a list of all the Swedish & French words and in the second screen (the quiz panel), choose some random word from the French list and see if the user knows the Swedish equivalent. If this is correct, then this code should work for what you want to do:

You may want to change the input screen (main) to have 2 buttons, one that adds the current words to the Swedish & French lists so you can enter as many as you’d like before starting the quiz and then a second button that starts the quiz. Similarly, on the second screen, add a second button for continuing the quiz and keep the first button the way it is to return to the word list entry screen.

Hope this helps,
Jon

Wow! Your my god! :wink: (Next after Steve Jobs of course :)) Yes that is exactly what Im trying to do! :slight_smile:

I did as you said and added an add and next button, 2 more questions now :slight_smile:

How does I make it not add if content of input fields are “”?
Is it possible to save the list so you can open it again?

Thanks once again! :slight_smile: This is my (well your ;)) first Applescript program and I must say that it’s quite easy, specially when there is a forum like this to ask questions on!

To keep it from adding blanks, try this code:

As for remembering the words added, there are a couple of ways of doing it. You could write to an external text file and read that in on launch, you could create a .plist file using the Defaults tool (see the AS Studio examples for how to use this), or you could change the input screen to include a table and set the window to autosave in Interface Builder.

Good luck,
Jon

Here’s a very quick first stab at a quiz app called Quizzer. You can download it directly from:

http://homepage.mac.com/jonn8/as/dist/Quizzer.hqx

This app will allow you to enter as many questions & answers as you’d like and then quiz you on those questions. (A question can be a standard question or, like the genesis of this app, a word in one language and the answer can be the equivalent word in another language. Or you can even use a question with multiple choice answers and simply put the right letter or number corresponding to the correct answer in the answer field.) It will store all of the questions & answers in a table and it writes & reads the questions & answers to a .plist file using the “defaults” tool so they are persistent through relaunches. There are some features in the preferences for randomizing the quiz, using a basic timer, and repeating questions. Please note that during the quiz the answers must be exact (spelling, punctuation, etc. all count) to get a correct response.

I may get around to adding an import/export feature for batch importing/exporting question & answer lists; improving the timer to set a maximum timeout; adding an option to move to the next question on an incorrect answer (right now it keeps asking the same question until you get it right); and adding more bells & whistles (literally) such as a buzz for an incorrect answer and a bell ding for a correct one; and generally improving & optimizing the code (it’s a bit of a mess right now and not commented at all).

If anyone sees a use for this, please let me know and, by all means, feel free to copy/incorporate/improve upon anything in the app in your own projects (a little credit would be nice, though).

Jon