# Script hangs while waiting for user input

**URL:** <https://www.ruby-forum.com/t/script-hangs-while-waiting-for-user-input/175844>\
**Category:** Ruby\
**Created:** [September 21, 2009, 11:09am UTC](https://www.ruby-forum.com/t/script-hangs-while-waiting-for-user-input/175844 "2009-09-21T11:09:14Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![landge](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5e925/32.png) [@landge](https://www.ruby-forum.com/u/landge)\
**Post date:** [September 21, 2009, 11:09am UTC](https://www.ruby-forum.com/t/script-hangs-while-waiting-for-user-input/175844/1 "2009-09-21T11:09:14Z")

</div>

Hi!

I want to send e-mail automatically from windows with help of “win32ole”  
and outlook. I wrote two short scripts:

1. one that sends the mail and

2. one that sends the keystrokes to the outlook security alert. (the  
security alert pops up, because it could be a virus which sends the  
e-mail.)

Is there a possibility to combine these to scripts in one? I tried a lot  
of different things, but the script hangs while outlook is waiting for  
the user input. That’s why I have to set up two cron-jobs. One script  
would make the whole thing less error prone (no timing issues with the  
cron-jobs).

Thanks for your help!

/landge

---

<div class="post-metadata">

**Author:** ![landge](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5e925/32.png) [@landge](https://www.ruby-forum.com/u/landge)\
**Post date:** [September 21, 2009, 2:52pm UTC](https://www.ruby-forum.com/t/script-hangs-while-waiting-for-user-input/175844/2 "2009-09-21T14:52:01Z")

</div>

There is something online which allows you to turn off / bypass that  
security feature.  
Look up “Advanced Security for Outlook 1.43” by Mapilab.

---

<div class="post-metadata">

**Author:** ![landge](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5e925/32.png) [@landge](https://www.ruby-forum.com/u/landge)\
**Post date:** [September 21, 2009, 4:15pm UTC](https://www.ruby-forum.com/t/script-hangs-while-waiting-for-user-input/175844/3 "2009-09-21T16:15:43Z")

</div>

On Mon, Sep 21, 2009 at 3:09 AM, Jule N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

An alternative to turning off the feature might be threads. It might be  
tricky though depending on if/how things block in this situation.  
Although  
if you are using Ruby 1.9 that shouldn’t be an issue.

–  
“Hey brother Christian with your high and mighty errand, Your actions  
speak  
so loud, I canâ€™t hear a word youâ€™re saying.”

-Greg Graffin (Bad Religion)

---

<div class="post-metadata">

**Author:** ![landge](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5e925/32.png) [@landge](https://www.ruby-forum.com/u/landge)\
**Post date:** [September 21, 2009, 6:21pm UTC](https://www.ruby-forum.com/t/script-hangs-while-waiting-for-user-input/175844/4 "2009-09-21T18:21:52Z")

</div>

Glen H. wrote:

> On Mon, Sep 21, 2009 at 3:09 AM, Jule N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> An alternative to turning off the feature might be threads. It might be  
> tricky though depending on if/how things block in this situation.  
> Although  
> if you are using Ruby 1.9 that shouldn’t be an issue.

I tried threads - but it didn’t work. Didn’t know that the Ruby-version  
is important… Will check if 1.9 is installed.

Thanks

> –  
> “Hey brother Christian with your high and mighty errand, Your actions  
> speak  
> so loud, I canâ€™t hear a word youâ€™re saying.”
> 
> -Greg Graffin (Bad Religion)

---

<div class="post-metadata">

**Author:** ![landge](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5e925/32.png) [@landge](https://www.ruby-forum.com/u/landge)\
**Post date:** [September 21, 2009, 6:38pm UTC](https://www.ruby-forum.com/t/script-hangs-while-waiting-for-user-input/175844/5 "2009-09-21T18:38:35Z")

</div>

On Mon, Sep 21, 2009 at 10:21 AM, Jule N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > Although  
> > speak  
> > so loud, I canâ€™t hear a word youâ€™re saying."
> > 
> > -Greg Graffin (Bad Religion)
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

1.9 uses OS Native threads while 1.8 uses green threads so if the ruby  
process is blocked then your “threads” a potentially blocked. I’ve  
never  
tried threads with 1.9 in Windows though so I don’t know how they  
behave.

–  
“Hey brother Christian with your high and mighty errand, Your actions  
speak  
so loud, I canâ€™t hear a word youâ€™re saying.”

-Greg Graffin (Bad Religion)

---

<div class="post-metadata">

**Author:** ![landge](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/b5e925/32.png) [@landge](https://www.ruby-forum.com/u/landge)\
**Post date:** [September 21, 2009, 6:34pm UTC](https://www.ruby-forum.com/t/script-hangs-while-waiting-for-user-input/175844/6 "2009-09-21T18:34:01Z")

</div>

Aldric G. wrote:

> There is something online which allows you to turn off / bypass that  
> security feature.  
> Look up “Advanced Security for Outlook 1.43” by Mapilab.

I’ll try that, thanks!
