LoginSignup
0
0

More than 5 years have passed since last update.

Finderで選択したExcelファイルをまとめて開くサービス

Last updated at Posted at 2018-01-16

Finderで複数選択したExcelファイルが開けない?

複数選択して、コマンド+O!
ところが、開けるファイルは一つだけ………

てっきり私の環境だけなのかと思ってたけど、他の環境でもみられるようなので、スクリプト書いてみました。

ソースコード


tell application "Finder" to set fileList to selection as alias list

if fileList is not "" then
    tell application "Microsoft Excel"
        repeat with aFile in fileList
            open aFile
        end repeat
    end tell
end if

AppleScriptはこんな感じでしょうか?

Automator

スクリーンショット 2018-01-17 1.52.32.png
新規からサービスを選択します。

スクリーンショット 2018-01-17 1.48.43.png

AppleScriptを実行を選択し、上記コードをペースト

検索対象Finder.appを選択することで、Finderのサーピスメニューにのみ表示されます。
適宜名前を付けて保存します。
(保存先:/Users/[username]/Library/Services/openExcelFile.workflow)

サービス

スクリーンショット 2018-01-17 1.58.36.png
システム環境設定 > キーボード > ショートカット
サービスに、先ほど保存したファイル名を選択して任意のショートカットを設定します。

注意

これでFinderで選択した複数ファイルを開くことができます。
ただ、ファイルの判定をしていませんのでExcelファイル以外も開いてしまいます。
(てっきりExcelで開こうとしてエラーになるかと思ったんですが、それぞれに関連付けされたアプリケーションで開かれるようです。)

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