Skip to content

Commit

Permalink
Add Open With Sublime script
Browse files Browse the repository at this point in the history
  • Loading branch information
rockia authored and thomaspaulmann committed May 27, 2022
1 parent 50dd2d2 commit ded3a01
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions commands/apps/sublime/open-with-sublime.applescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/osascript

# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Open with Sublime
# @raycast.mode silent

# Optional parameters:
# @raycast.icon https://cdn.worldvectorlogo.com/logos/sublime-text.svg
# @raycast.packageName Open With Sublime

# Documentation:
# @raycast.author Rock Hu
# @raycast.authorURL https://twitter.com/0xRock
# @raycast.description Open Current Focus Directory in Sublime

set targetApp to path to application "Sublime Text"

tell application "Finder"
set theSelection to selection
if theSelection is {} then
if exists Finder window 1 then
set currentDir to target of Finder window 1 as alias
open currentDir using targetApp
end if
else
open theSelection using targetApp
end if
end tell

0 comments on commit ded3a01

Please sign in to comment.