Posted by Begryphon on Sat, 24 Jul 2010 12:53:51
Creating and editing documents
If you are creating and editing documents using TextEdit.app, convert the documents to ".txt" files by choosing the "Format" menubar item and the "Make Plain Text" choice. When you save the file, you can put the ".lua" or ".xml" suffix on the end and delete the ".txt" suffix.
www.barebones.com have a free powerful text editor, TextWrangler. The program is a lite version of the awesome BBEdit.app. It supports source code coloring to help identify common typing errors such as forgetting a ">" or a closing quote. Well worth while to invest time learning to use it. It has good help, tutorials, and manual.
Using the MacOSX lua interpreter furnished by the "World of Warcraft Programming" authors
Download and install the interpreter using the information in the book and the appropriate online forum.
Create a ".lua" file using a text editor and save the file on your computer. Open a Finder window that shows the file.
In the terminal window, type
Thats "lua space minus the letter i space." Don't put a space between the minus sign and the "i."
Then drag the icon of the file from the finder window and drop it into the terminal window after the "minus eye space". The Mac will convert the dragged info into the file path needed by the interpreter.
Press the return key. The lua interpreter will process the file stopping at the first error or (praise be) at the end of the file and be ready for the next lua command you type in (the "minus eye" told UNIX to keep the lua interpreter running when the file was completed.
If there was an error, correct the text file and save it. then, in the terminal window press the control and z keys together. "ctrl z" terminates the lua interpreter. Then press the up-arrow key to scroll back to the last command you entered in the terminal window. If it isn't the "lua -i" with the file name, you can continue pressing the up key until you recover that line. When you do, press the return key to process the lua file again.
Comment: I like doing lua code this way because I can quickly return the lua interpreter to the condition it should be in according to the programming book's instructions.
Next Up on my event horizon
I want to learn how to use the UI.xsd file with a XML editor to provide better support for writing XML code.
I want to find out how to use the UI.xsd file info to create a ".plist" file for TextWrangler to use the "install a codeless module" feature.
Posted by jnwhiteh on Sat, 24 Jul 2010 22:39:52
I'm not sure why any of this is relevant to the 'Book Support' forum. Are you proposing changes to the book? If so, I'm sorry, but I'm not likely to include anything like this in a Mac OS X specific portion of an updated version. It's too much alteration of the existing text and there is limited added value to including it.
If you have questions, please feel free to post them, but a more appropriate forum for something like this would be the 'Development' forum, with a prefix of HOWTO, or on your own person site/blog or what-have-you. None of it is specific to writing addons for World of Warcraft.
Posted by Begryphon on Mon, 26 Jul 2010 12:38:56
My apologies. My intent was to show appreciation and pass forward the help you had given me in running the lua interpreter with a file on my mac.
Posted by jnwhiteh on Mon, 26 Jul 2010 13:46:08
No problem, but that information is already available in another thread. Perhaps I'll create a HOWTO forum for stuff like this.