Très désolé, @myildi that I didn’t mention that possibility! if you have the Pro version of Hook, here’s a script you can paste in Hook > Preferences > Script Editor tab > Firefox Get Address tab
use framework "AppKit"
-- classes, constants, and enums used
property NSShiftKeyMask : a reference to 131072
property NSAlternateKeyMask : a reference to 524288
property NSControlKeyMask : a reference to 262144
property NSEvent : a reference to current application's NSEvent
set modifier_down to true
repeat while modifier_down
set modifier_flags to NSEvent's modifierFlags()
set option_down to ((modifier_flags div (get NSAlternateKeyMask)) mod 2) = 1
set shift_down to ((modifier_flags div (get NSShiftKeyMask)) mod 2) = 1
set control_down to ((modifier_flags div (get NSControlKeyMask)) mod 2) = 1
set modifier_down to option_down or shift_down or control_down
end repeat
tell application "Firefox"
activate
delay 0.05
set myName to get name of front window
if version > 72 and myName ends with " - Mozilla Firefox" then
if length of myName > 18 then
set myName to text 1 through -19 of myName
else
set myName to ""
end if
end if
end tell
tell application "System Events"
keystroke "l" using {command down}
keystroke (key code 53)
keystroke (key code 53)
--keystroke "c" using {command down}
tell process "Firefox"
click menu item "Copier" of menu "Édition" of menu bar 1
end tell
delay 0.05
set theClipboard to current application's NSPasteboard's generalPasteboard's stringForType:(current application's NSPasteboardTypeString)
return ("[" & myName & "](" & the theClipboard as string) & ")"
end tell
The key modified line is
click menu item "Copier" of menu "Édition" of menu bar 1
so you can just change that one instead if you like.
I’ve tested on Big Sur with latest Hook and same Firefox version.
Luc