Skip to content

Instantly share code, notes, and snippets.

@davebrny
Last active December 10, 2017 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davebrny/51fe9b24b17db5960700a3f1947b8c82 to your computer and use it in GitHub Desktop.
Save davebrny/51fe9b24b17db5960700a3f1947b8c82 to your computer and use it in GitHub Desktop.
(autohotkey) - get the file that is open/focused in sublime text
sublime_file() {
winGetTitle, sublime_title, ahk_exe sublime_text.exe
splitPath, sublime_title, , file_dir, file_ext, name_no_ext
split := strSplit(file_ext, a_space) ; remove project name or • from an unsaved file
return file_dir "\" name_no_ext "." split[1]
}
/*
description = get the file that is open/focused in sublime text
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment