« [VS Code]VS CodeでURLからファイルを指定して開く(Mac版)Opening VS Code with URLs | トップページ | [mobileconfig]com.apple.TextEdit »

[VS Code]VS Codeでファイルを開く

#!/usr/bin/env osascript
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7
#
#
#
#
# com.cocolog-nifty.quicktimer.icefloe
----+----1----+----2----+-----3----+----4----+----5----+----6----+----7

use AppleScript version "2.8"
use framework "Foundation"
use scripting additions

tell application "Finder"
set aliasDefaultLocation to (path to desktop folder from user domain) as alias
end tell

set listChooseFile to (choose file with prompt "ファイルを選んでください" default location aliasDefaultLocation of type {"public.data"} with invisibles and multiple selections allowed without showing package contents) as list

repeat with objFile in listChooseFile
set theFilePath to POSIX path of objFile as text
set strCommandText to "/usr/bin/open \"vscode://file/" & theFilePath & "\"" as text
do shell script strCommandText
end repeat

|

« [VS Code]VS CodeでURLからファイルを指定して開く(Mac版)Opening VS Code with URLs | トップページ | [mobileconfig]com.apple.TextEdit »

AppleScript Microsoft」カテゴリの記事