forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50dd2d2
commit ded3a01
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |