Макрос горячая клавиша для «Сохранить изображение как ...» в Firefox?

4602
Wuschelbeutel Kartoffelhuhn

Соответствующая информация о ПК:

  • Windows 7 64bit
  • Firefox (последний)
  • Клавиатура Logitech G710 + с программным обеспечением Logitech Gaming

Прямо сейчас я должен:

  1. Наведите курсор на изображение
  2. щелкните правой кнопкой мыши
  3. Нажмите « Сохранить изображение как .. »
  4. Нажмите «Сохранить» в окне сохранения проводника (и, возможно, перейдите на рабочий стол)

Я вместо этого хочу иметь возможность:

  1. Наведите курсор на изображение
  2. Нажмите кнопку G4 на моей клавиатуре G710 +

Моим первым выбором было бы расширение Firefox, за которым следовал скрипт Lua (это то, что позволяет использовать Logitech Gaming Software), затем AutoIt (я могу кодировать простые вещи), а затем Autohotkey (никогда раньше не использовал и не устанавливал) ,

В последних трех случаях я явно не ожидаю кода. Я намерен только выяснить, есть ли расширение для Firefox или более простое решение, о котором я не думал.

4

1 ответ на вопрос

3
Robert Ilbrink

You will have to use The Key History in AutoHotKey to find out the ScanCode or keyname of your G4 key to launch this. Alternatively, you could map the G4 key internally to e.g. CtrlAltWinF12 and use the 2nd hotkey option.
The script will only execute when Firefox is active. It will Launch the rightClick menu, then send v, wait for the save as window and click Enter.

#SingleInstance Force #installKeybdHook #Persistent #IfWinActive, ahk_class MozillaWindowClass SC123:: ; or ^!#F12::, select one of the two options Send, Sleep, 30 Send, v WinWaitActive, Save Image ControlSend, Button1,, Save Image Return #IfWinActive 

Find the scancode:

Right Click on AutoHotKey Icon. Select Open, Type Ctrlk, hit G4, then F5 to refresh the page and see the scancode for G4 towards the bottom.


In AutoHotKey you can define hotkeys in multiple ways. Examples:

a::Send, Hello World! 

When you press a it will send "Hello World" to whatever is active on your screen right then.

F12::Send, Hello World! 

Same but now for the F12 key

^!#F12::Send, Hello World! 

Same but now for the Ctrl+Alt+Win+F12 key combination

F1::Send, 

Would remap your F1 key into the behaviour of the F12 key

SC058::Send, Test 

Uses ScanCode 058 (is the F12 key) to send "Test".

:*:ahk::AutoHotKey 

Expands abc into the word AutoHotKey.

In your situation, you will have to decide which hotkey combination will trigger the script.

Here is some documentation:
http://www.autohotkey.com/docs/KeyList.htm
http://www.autohotkey.com/docs/Hotkeys.htm

Oh, übrigens, the double :: separates the hotkey from the action and the ; is the comment separator. Grüsse.

Спасибо за Ваш ответ. Что делает строка: «SC123 ::; или ^! # F12 ::, выберите один из двух вариантов»? Я никогда не видел код autohotkey, поэтому мне просто интересно, что означает двойная двоеточие и точка с запятой Wuschelbeutel Kartoffelhuhn 11 лет назад 0

Похожие вопросы