Created
November 3, 2014 16:04
-
-
Save griotspeak/61f50e6466c5f0434676 to your computer and use it in GitHub Desktop.
Applescript to switch to first open tab ending with ".swift"
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
set current_document_path to "" | |
tell application "Xcode" | |
set last_word_in_main_window to ".swift" | |
if (last_word_in_main_window is "Edited") then | |
display notification "Please save the current document and try again" | |
-- eventually we could automatically save the document when this becomes annoying | |
else | |
set current_document to document 1 whose name ends with last_word_in_main_window | |
set current_document_path to path of current_document | |
end if | |
end tell | |
if (current_document_path is not "") then | |
tell application "Xcode" | |
open current_document_path | |
end tell | |
end if |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment