[Mac] 開啟一個應用程式的多個複本,方便比對或作業
最近在整理去沖繩的照片,想要同時開兩個 PhotoScapeX 的視窗,
一個視窗用來瀏覽所有的照片,把要用在網誌上的複製到一個目錄;
而另一個視窗,則用來調整那目錄裡的圖片~
可是,如果在 PhotoScapeX 的圖示上按右鍵,並沒有什麼選項可以再開一個視窗…
(不像 Windows 是可以按右鍵 > 點應用程式的名稱,就能再開一個)
上網查了一下,原來要做到也蠻容易的,只是要下指令~
打開終端機 (terminal),執行 open 看一下用法:
testuser@localhost ~/ $ open Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-s ][-b ] [-a ] [filenames] [--args arguments] Help: Open opens files from a shell. By default, opens each file using the default application for that file. If the file is in the form of a URL, the file will be opened as a URL. Options: -a Opens with the specified application. -b Opens with the specified application bundle identifier. -e Opens with TextEdit. -t Opens with default text editor. -f Reads input from standard input and opens with TextEdit. -F --fresh Launches the app fresh, that is, without restoring windows. Saved persistent state is lost, excluding Untitled documents. -R, --reveal Selects in the Finder instead of opening. -W, --wait-apps Blocks until the used applications are closed (even if they were already running). --args All remaining arguments are passed in argv to the application's main() function instead of opened. -n, --new Open a new instance of the application even if one is already running. -j, --hide Launches the app hidden. -g, --background Does not bring the application to the foreground. -h, --header Searches header file locations for headers matching the given filenames, and opens them. -s For -h, the SDK to use; if supplied, only SDKs whose names contain the argument value are searched. Otherwise the highest versioned SDK in each platform is used.
我們會用到 -n 這個選項,用來強制開啟一個新的視窗。
如果不加這選項的話,如果程式已經開啟了,就不能再執行另外一份複本。
還會用到 -a 選項,用來指定應用程式的名稱。
像我想要再開一個 PhotoScapeX 的視窗,就執行下面的指令:
open -n -a PhotoScapeX
這時就出現第二個 PhotoScape 的視窗囉,圖示也有兩個:
參考資料:Launch & Run Multiple Instances of Any Application in Mac OS X
(本頁面已被瀏覽過 613 次)