EugZol
EugZol

Reputation: 6545

Launching file from Ruby on Mac OS (as if it was double-clicked in Finder)

I want to 'launch' file from Ruby on Mac OS. I.e., I want to write something like:

launch 'my.pdf'

...and have Preview (default program associated with PDF files) showing it.

Upvotes: 0

Views: 241

Answers (1)

Axel Tetzlaff
Axel Tetzlaff

Reputation: 1364

You can call

exec 'open my.pdf'

to execute the osx shell command 'open' which will launch the associated application

Upvotes: 1

Related Questions