From 80b3d1c5f47acd867339ce42d5fe9960c2bf5f45 Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 11 Oct 2025 00:31:39 +0100 Subject: firefox is meh on automation --- lib/doc/jao-mac.el | 21 +++++++++++++++------ 1 file 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 -- cgit v1.2.3