Jul 23, 2014

Mac OS X Mavericks - 螢幕截取:設定目錄和前置檔名 (filename prefix)

Mac OS內建螢幕截取程式,但是如何改變截圖存檔的預設路徑和檔名?
常用:Shift+Command + 4

  • 改變預設儲存路徑:defaults write com.apple.screencapture location ~/Desktop/
  • 改變預設儲存前置檔名 (filename prefix):defaults write com.apple.screencapture name screencapture
  • 改完設定後,要重設:killall SystemUIServer

自定螢幕截取路徑會方便許多。例如,用Bolgger寫部落格,螢幕截圖指定到和Google+ Photo (Picasa) 同步程式的路徑,就可以自動同步到Google Storage,可以撰寫時直接挑選照片,不用再費時上傳,G+又要詢問你是否分享。

若每次要變更到不同主題路徑,要打這麼長指令很麻煩,我就寫了以下的shell scripts。

  • nano cpath #create a file cpath (capture path)

echo "Change the default location of screen snapshot to: $1"
defaults write com.apple.screencapture location "$1"
killall SystemUIServer

  • 存檔結束,並改為可執行:chomd 755 cpath

同理,設定filename prefix也是一隻shell scripts。

  • nano cname #create a file cname (capture name)

echo "Change the default name prefix of screen snapshot to: $1"
defaults write com.apple.screencapture name "$1"
killall SystemUIServer




  • 存檔結束,並改為可執行:chomd 755 cname
之後,要改變設定就這樣執行:
$ . cpath ~/Desktop/Snapshot/MacOS/
Change the default location of screen snapshot to: /Users/me/Desktop/Snapshot/MacOS/
$ . cname screencapture
Change the default prefix name of screen snapshot to: screencapture



No comments :

Post a Comment