How to prevent a Lua file closing when I press enter? - input

I have a block of code in sublime text, and whenever I press enter on the Lua file its connected to, the file closes, so I can't enter input. The code is below.
io.write("name?")
local name = io.read()
io.write("hello " .. name)
I expected it to print "hello " and then whatever input was entered, but the file closes instead.

Related

how to delete # in robot

Input Text id=userNameId ${EMPTY}
Input Text id=userNameId test#gmail
Hi. I should put an email address, but when you click on in and start typing, a # appears.
It ends up with #test#gmail.com. How do I delete it?
Input Text id=userNameId ${EMPTY}
Input Text id=userNameId test#gmail
Hi. I should put an email adress, but when you click on in and start typing, a # appears.
It ends up with #test#gmail.com. How do I delete it?

Autohotkey - Hotstring not working after Tab Trigger

I've written a Autohotkey script to auto-complete print statement in java
System.out.println("");
by clicking s and then Tab and jump to next line when cursor is between quotation marks by clicking Shift + Enter as follows
:*:s`t::System.out.println("");{left}{left}{left}
+Enter::
ClipSaved := ClipboardAll
Loop
{
clipboard =
Send, +{Right}
Send, ^c
ClipWait , 0.2
StringRight := InStr(Clipboard,OutputVar, 1)
If OutputVar = {;}
Send ^v
Send {Right}
Send {Right}
Send {Right}
Send {Enter}
break
}
clipboard := ClipSaved
Return
The problem here is it works good when I type s and then Tab and when clicking Shift + Enter jumps to new line. But if I type anything between quotations and then hit Shift + Enter it jumps to new line but then onwards the auto-complete is not working i.e., I'm not getting print statement when typing s and then Tab.
The image of error is attached for illustration. You can copy/paste the code and tell me where the error is, as I'm unable to figure it out.
If you want to trigger a hotstring after you typed something, you need to use the question mark option. Try this:
:*?:s`t::System.out.println("");{left}{left}{left}

Move cursor to a new line after "Send Selection to Terminal" action in Geany

I set in geany a key shortcut to Send Selection to Terminal action which send the current line (or selection) to the build-in terminal (according to: shortcut to send selection to terminal in geany).
Then I change send_selection_unsafe=false to send_selection_unsafe=true in the geany.conf file (according to: Geany: execute line in Terminal)
Everything works well, I can send a line to terminal which is automatically executed. My problem is that at this point the cursor remains on the line after sending it to terminal.
Maybe I miss something, but is it possible to set or configure behaviour that cursor is automatically move to next line after using Send Selection to Terminal so than I can sending lines to terminal one after another (without hitting down arrow) ?
like this:
print("hello world!")
#I want cursor on this line after sending previous line to terminal, so this can be send to terminal immediately

How to get a script file to accept user name thru dialog box, save name, but have a different script operate from that point on

I am attempting to accept a user name through an Applescript script: I have accomplished this. So I am thinking that I need to have the name saved to a file because thats all i need and have another piece of script activate every time I click on the app from that point and retrieve the name. My question is how would I get it to not accept the original script after the first run.
AppleScript Overview
| Scripting with AppleScript
One way would be to use properties.
property MyUserName : ""
if MyUserName is "" then
display dialog "User Name:" default answer "" buttons {"Cancel", "Continue…"} default button 2 with icon 0
copy the result as list to {button_pressed, text_returned}
if button_pressed is "Cancel" then
beep
return
end if
if text_returned is not "" then set MyUserName to text_returned
else
display dialog "Stored user name: " & MyUserName buttons {"Ok"} default button 1 with icon 1
end if
The property-value is stored within the compiled script. It also works when the script is saved as an application. Opening and recompiling it in AppleScript Editor resets the values.

How to Open Notepadd ++ With Textbox.text?

I have a small program that I am working on that grabs a script within an object model. I can get the script to display in the text box and I can get notepad++ to launch on button click.
What I would love to do is have the text from the text box open inside notepad++ so that i may edit the script.
Does anyone out there have any ideas?
Save the text from your text box to a file, like this:
System.IO.File.WriteAllText("path and name of text file.txt", textBox1.Text)
Now you can force the user to use Notepad, by doing this:
Process.Start("path to notepad.exe", "path and name of text file.txt")
Or you can have the system determine what the user's preferred application (say they have Notepad++) is for a .txt by doing this:
System.Diagnostics.Process.Start("path and name of text file.txt")