diff options
author | jao <jao@gnu.org> | 2025-10-11 00:31:39 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2025-10-11 00:31:39 +0100 |
commit | 80b3d1c5f47acd867339ce42d5fe9960c2bf5f45 (patch) | |
tree | 3391b287ba2d76cb5ac72271b7558558ed26b207 /lib/doc/jao-mac.el | |
parent | f5b74e1f1337be0ab301c36fde764ede482576a9 (diff) | |
download | elibs-80b3d1c5f47acd867339ce42d5fe9960c2bf5f45.tar.gz elibs-80b3d1c5f47acd867339ce42d5fe9960c2bf5f45.tar.bz2 |
firefox is meh on automation
Diffstat (limited to 'lib/doc/jao-mac.el')
-rw-r--r-- | lib/doc/jao-mac.el | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/lib/doc/jao-mac.el b/lib/doc/jao-mac.el index 855a91b..d2e5290 100644 --- a/lib/doc/jao-mac.el +++ b/lib/doc/jao-mac.el @@ -155,17 +155,26 @@ ;;; Firefox (defvar jao-ffox--current-url-script (jao-mac-applescript-prepare - "tell application \"Firefox\" to activate" - "tell application \"System Events\"" - "keystroke \"l\" using command down" - "keystroke \"c\" using command down" + "tell application \"Firefox\"" + " activate" + " delay 0.15" + " tell application \"System Events\"" + " keystroke \"l\" using command down" + " delay 0.20" + " keystroke \"c\" using command down" + " end tell" + " delay 0.5" "end tell" - "delay 0.5" "return the clipboard")) (defun jao-firefox-current-url () (let ((res (jao-mac-run-applescript jao-ffox--current-url-script))) - (jao-mac-run-applescript "tell application \"Emacs\" to activate"))) + (jao-mac-run-applescript "tell application \"Emacs\" to activate") + res)) + +(defun jao-firefox-open () + (interactive) + (jao-mac-open "-a Firefox")) ;;; DevonThink |