Last active
July 17, 2019 05:06
-
-
Save lawlist/d7000235c8510460079149ad25233f0d to your computer and use it in GitHub Desktop.
Get the bounds of the selected frame using an applescript.
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
Feature request 18283 was previously added to Emacs 25 and the master branch in | |
conjunction with feature request 21415. In a nutshell, it is now possible to act | |
upon Emacs (to some degree) using an applescript. | |
CAVEAT: Feature request 18283 was implemented primarily to facilitate debugging, | |
and not to control Emacs per se using applescripts. | |
(defun get-bounds () | |
"Return the bounds of the selected frame." | |
(let* ((script (concat "tell front window of application \"Emacs\"\n" | |
"return get bounds\n" | |
"end tell")) | |
(command (format "osascript -e '%s'" script))) | |
(car (split-string (shell-command-to-string command) "\n")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment