2013-01-14 46 views
1

我想在Mac OS X中有一个应用程序,使我能够在同一个全屏窗口中拥有Sublime Text 2和一个终端(用于显示测试结果,运行grunt任务等) 。我无法找到有这种行为的应用程序,我想用可可分割视图自己再现它。 我想知道这是否是可能的,如果是,我怎么能开始实施其在可可分割视图内嵌入外部应用程序

谢谢

回答

1

不能创建从其他2个应用程序的新应用程序。它不会工作。但是,您可以使用applescript使您可以根据需要轻松定位这些窗口。

作为一个例子,我将使用Safari和Terminal作为我的2个应用程序。打开它们并将它们放置在屏幕上,因为您希望它们出现。我打开每个窗口并将它们放在一起。然后,我跑到这个AppleScript的得到他们的窗口大小和位置属性...

tell application "System Events" 
    tell process "Safari" 
     set safariSize to size of window 1 
     set safariPosition to position of window 1 
    end tell 
    tell process "Terminal" 
     set terminalSize to size of window 1 
     set terminalPosition to position of window 1 
    end tell 
end tell 
return {safariSize, safariPosition, terminalSize, terminalPosition} 

然后我复制/从脚本粘贴结果放入脚本中的“theValues”变量。现在,只要我想要,我可以运行此脚本来重新创建这些窗口位置。

set theValues to {{1001, 1025}, {0, 22}, {613, 1024}, {1003, 22}} 

tell application "Safari" to activate 
tell application "Terminal" to activate 

tell application "System Events" 
    tell process "Safari" 
     set size of window 1 to item 1 of theValues 
     set position of window 1 to item 2 of theValues 
    end tell 
    tell process "Terminal" 
     set size of window 1 to item 3 of theValues 
     set position of window 1 to item 4 of theValues 
    end tell 
end tell 

我希望有帮助。祝你好运。

+0

谢谢你,不幸的是,这不会在全屏幕上工作,这是我想要做的。我已经有非全屏定位的解决方案:) – ArtoAle

+1

正确,它不会全屏显示,但您将无法做到这一点。如果不使用这两种应用程序的功能编写自己的应用程序,就可以获得最接近的结果。我不认为你想这样做,所以只要接近这个近似值就行。 – regulus6633

+0

这听起来像OP想做的那样,所以我建议他看看Ace,Cloud9和GateOne等东西......您可以用完整的终端构建自己的IDE,然后以全屏模式运行浏览器窗口以最大化真实房地产。您还可以从云实例的ChromeBook上运行这些。就我个人而言,我更喜欢一些全屏,分割窗格tmux会话远程运行,在一个窗格中使用vim/emacs强大的编辑器... –

相关问题