Thursday, December 15, 2011

Re: run shell command, launch app, but keep focus

It turns out that `open` has `-g` option to open things in background…
On Dec 12, 2011, at 8:31 PM, Zhao Cai wrote:

> You can use system call to applescript to do this without activate chrome. The script would be like this:
>
> set theURL to "…..."
> tell application "Google Chrome"
> open location theURL
> end tell
>
> Sorry, this code is untested. You will need to finish and debug it.
>
> On Dec 12, 2011, at 4:42 PM, Alejandro Exojo wrote:
>
>> El Lunes, 12 de diciembre de 2011, Chris Lott escribió:
>>> I have the following command mapped for previewing markdown as HTML:
>>> silent !pandoc -f markdown -t html -s -o %:r.html %:r.mtxt | open -a
>>> /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome
>>> %:r.html
>>>
>>> However, when the browser launches, Vim loses focus. I'd like Vim to
>>> keep focus. Is there a way I can do that?
>>
>> The window with the focus is managed by the operating system/window manager. I
>> would try looking for this issue with a search related to Mac OS X window
>> management. I doubt Vim can do anything about it, except run another command
>> that sets the focus back to Vim.
>>
>> --
>> Alex (a.k.a. suy) | GPG ID 0x0B8B0BC2
>> http://barnacity.net/ | http://disperso.net
>>
>> --
>> You received this message from the "vim_use" maillist.
>> Do not top-post! Type your reply below the text you are replying to.
>> For more information, visit http://www.vim.org/maillist.php
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: