I have a stack where the user can edit a message before sending off an email.
If the user hits the return key, it sends off the message. I would like pressing the return key to generate a linefeed or CR
I have used this code:
on returnInField
put return after me
end returnInField
This code does works but it sends the cursor to the bottom of the window and not to the next line.....
Any ideas?
Thanks
Rob
Forcing a return/Carriage Return
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Forcing a return/Carriage Return
Rob Glassman
ArkStar
ArkStar
Re: Forcing a return/Carriage Return
I am not sure what distinguishes the two operations. But does this do what you want?
You mentioned that you wanted to go to the next line. The previous script does that. But it does not add a return. If you want that:
And I assume that the mail is sent in another line of code somewhere.
Code: Select all
on returnInField
select after line word 2 of the selectedLine of me + 1 of me
end returnInField
Code: Select all
on returnInField
put return after line word 2 of the selectedLine of me of me
end returnInField
Re: Forcing a return/Carriage Return
Hi arkstar,
you trigger a command/handler on RETURN in that field right?
But this is not in your "returninfeld" handler? So how do you do this?
Whatever, you could do this:
This will wait 1 tick (= 1/60 second) before the action takes place,
so time enough for the field to put that CR automatically at the right place!
Know what I mean?
Best
Klaus
you trigger a command/handler on RETURN in that field right?
But this is not in your "returninfeld" handler? So how do you do this?
Whatever, you could do this:
Code: Select all
on returnInField
send "the_handler_that_needs_to_be_triggerd" to this stack in 1
pass returninfield
end returnInField
so time enough for the field to put that CR automatically at the right place!

Know what I mean?
Best
Klaus
Re: Forcing a return/Carriage Return
Thanks guys for the FAST responses!
I used dunbarx's code and it worked perfectly!
Thanks so much!
Rob
(arkstar)
I used dunbarx's code and it worked perfectly!
Thanks so much!
Rob
(arkstar)
Rob Glassman
ArkStar
ArkStar