# In Shoes, whye does ask\_open\_file run a shoes app?

**URL:** <https://www.ruby-forum.com/t/in-shoes-whye-does-ask-open-file-run-a-shoes-app/194070>\
**Category:** Ruby\
**Created:** [August 29, 2010, 8:43pm UTC](https://www.ruby-forum.com/t/in-shoes-whye-does-ask-open-file-run-a-shoes-app/194070 "2010-08-29T20:43:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ed\_Howland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7993a0/32.png) [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Post date:** [August 29, 2010, 8:43pm UTC](https://www.ruby-forum.com/t/in-shoes-whye-does-ask-open-file-run-a-shoes-app/194070/1 "2010-08-29T20:43:39Z")

</div>

If I have a bit of code inside Shoes.app block, like this

keypress do |k|  
case k

# …

when :alt\_o  
@contents = File.read(ask\_open\_file)  
end  
end

it runs the file (if it is a shoes app). Otherwise, it seems to do  
nothing and returns nil.

If you run it outside of the Shoes.app block, pas in the manual  
example] it works ok.

Does Shoes.app set the context for ask\_open\_file to be able to run new  
apps? How can I change this?

Thanks,  
Ed

Ed Howland

> **[Green Programming - Blogging about Ruby, jQuery and Beyond!](https://greenprogrammer.wordpress.com)**
>
> Just another WordPress.com weblog

[http://twitter.com/ed\_howland](http://twitter.com/ed_howland)

---

<div class="post-metadata">

**Author:** ![Ed\_Howland](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/7993a0/32.png) [@Ed\_Howland](https://www.ruby-forum.com/u/Ed_Howland)\
**Post date:** [August 29, 2010, 9:10pm UTC](https://www.ruby-forum.com/t/in-shoes-whye-does-ask-open-file-run-a-shoes-app/194070/2 "2010-08-29T21:10:00Z")

</div>

Hey Ed-

This is… very strange. And certainly a bug. What platform are you  
on, and are you using Policeman or Rasins? I couldn’t recreate this on  
OSX Policeman. Using these two scripts: [556579’s gists · GitHub](http://gist.github.com/556579)  
, when I run test1, and open test2, the alert returns the text of  
test2.
