TOP > Programming > Lua > Lua with Terapad


#### Lua with Terapad ####
Guess what! The Terapad that I use everyday is so sweet that she kindly run Lua scripts I write with her immediately right after I press the F9 key.
What? You envy me? I knew it!
Okay, you lucky guys. I'll tell you how to do that. You must thank me!

[What's TeraPad?]
It's a pretty nice text editor.
TeraPad Official Web Site
#### Steps ####
Do you remember the app to run Lua script simply that I introduced befor?
In short, this section shows how to use the app as one of TeraPad tools.

First, open your TeraPad.
Go to 'ツール' ('Tool') > 'ツールの設定' ('Configuration').
Because what we want is to configure tool's settings.

Here we are in 'ツールの設定画面' (configuration mode for TeraPad tools). Because we just pressed 'ツールの設定' a little while ago.
Now we can see so much buttons on the right side of this window.
Which button should we press next?
Don't you think '追加' (Add) sounds good? After all, what we want is to add new one, right?

Here we go to add! Well...Looks like we have too many items.
We got lost! Oh my Budhaness...

Luckyly we have a set of sample answers here.
Let's see one by one.

[名前] (Name)
I think 'Lua' wouldn't be so bad. Because it's for Lua after all.
But you can name her a nicer one as you are the gratest inventor in the naming world.

[実行ファイル] (Execute File)
Any apps we put this text box would be going to run as a TeraPad tool.
Here we are supposed to use the 'SimpleLuaExecuter.exe' that we've shared since the previous article.

[コマンドラインパラメータ] (Run-time parameters)
The answer is "%f".
This parameter is going to be given to the app we just put above,
Remember that what we want to do is to tell the app the Lua file's path we write on the TeraPad.
Looks like TeraPad interprets %f as the file's path you are editing at that time.

Yes? You said what a weird set of quortations ("") the %f has?
That's because……All the better to eat you with!
In other words, to make sure there's no problem when the path has a white space in it.

[キー] (Key)
It's for the Hot Key.
Are you wondering how to set this? You can set it by pressing any key looks desireble to you after pressing left click on this box. Don't even think of putting the key's name as a word, okay?
Just to let you know, in my case I pick F9 key up because I sort of have an addiction with F9 key.
Which key would you like to be with?

[Other configurations]
I'm full.

It turns out like this.
Looks like we successfully made it. I know you can't wait to try this! Me too!
#### How to Enjoy ####
Let's make a text file that hopefully can be interpreted as a Lua script.
Then press the F9 key. How'd it go? We got nervous!

Now we can see that something appears! Thank Buddhaness!