LoginSignup
0
0

More than 1 year has passed since last update.

Finder でフォルダのクイックアクションに「ファイルを作成」を追加する

Posted at

Mac に標準搭載されている自動化ツールである Automator を利用します。

コード以外の部分については以下の記事を参照してください。

シェルスクリプト
# フォルダへ移動
cd $1

# ファイル名を入力
filename=$(
	osascript -e 'display dialog "ファイル名を入力" default answer "" 
    set the filename to text returned of the result
    return filename'
)

# ファイル名が入力されているかチェック
if [[ $filename = "" ]];
then
    osascript -e "display dialog \"ファイル名が空です。\" with title \"エラー\" with icon caution buttons {\"OK\"} default button 1"
    exit
fi

# ファイルを作成
touch $filename
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0