Applescript以使用特定编辑器在finder中打开选定的文件

【Applescript以使用特定编辑器在finder中打开选定的文件】莫问天涯路几重,轻衫侧帽且从容。这篇文章主要讲述Applescript以使用特定编辑器在finder中打开选定的文件相关的知识,希望能为你提供帮助。
This Applescript take the selected file in Finder and open it with Sublime Text 2 (~/bin/subl). Using Alfred you can bind a global hotkey for this script, so you can edit your files with just a keypress, without worrying about the default editor.

  1. tell application " Finder"
  2. activate
  3. set filePath to ( POSIX path of ( target of front window as alias) )
  4. set fileAlias to the selection as alias
  5. set fileName to name of fileAlias
  6. do shell script " ~/bin/subl " & filePath & fileName
  7. end tell


    推荐阅读