2014-12-04 29 views
2

我想用emacs在交互選擇區域的情況下生成OS X屏幕截圖。run os x screencapture from emacs call-process

在命令行中可正常工作

screencapture -i ~/test.png 

未創建的文件,不過,當我把這個使用(呼叫過程...)

(call-process "screencapture" nil nil nil "-i" "~/test.png") 

我是什麼失蹤?

回答

3

嘗試使用設置爲t的第三個參數運行它,以將命令的輸出插入當前緩衝區。它說:

screencapture: cannot write file to intended destination, ~/test.png 

這是因爲~縮寫的主目錄是由外殼擴展,但call-process繞過殼直接傳遞參數的命令。嘗試明確指定路徑,而不是,例如像這樣:

(call-process "screencapture" nil nil nil "-i" "/Users/me/test.png") 
+0

謝謝。 +1爲好的解釋。 – Andreas 2014-12-04 11:51:27