Created
February 24, 2018 09:15
-
-
Save tctony/5c2aebdd92d95fe5523a75ff95931175 to your computer and use it in GitHub Desktop.
xcode_open_file_in_emacs
This file contains hidden or 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
| tell application "Xcode" | |
| set last_word_in_main_window to (word -1 of (get name of window 1)) | |
| if (last_word_in_main_window is "Edited") then | |
| display dialog "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 | |
| -- display dialog current_document_path | |
| do shell script "/usr/local/bin/emacsclient -c " & quoted form of the POSIX path of the current_document_path | |
| end if | |
| end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment