Commands fixes + New commands
This commit is contained in:
parent
1033840325
commit
fc764c0c85
60 changed files with 404 additions and 103 deletions
|
|
@ -8,6 +8,4 @@ RegRead, BrowserFullCommand, HKEY_CLASSES_ROOT, %BrowserKeyName%\shell\open\comm
|
|||
StringGetPos, pos, BrowserFullCommand, ",,1
|
||||
pos := --pos
|
||||
StringMid, BrowserPathandEXE, BrowserFullCommand, 2, %pos%
|
||||
Run, % BrowserPathandEXE
|
||||
|
||||
|
||||
Run, % BrowserPathandEXE
|
||||
|
|
@ -3,4 +3,9 @@
|
|||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
|
||||
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
|
||||
|
||||
Run C:/Program Files (x86)/Google/Chrome/Application/chrome.exe "https://google.com"
|
||||
#Include _include.ahk
|
||||
|
||||
args = %1%
|
||||
path := DefaultBrowser()
|
||||
|
||||
Run, %path% %args%
|
||||
Binary file not shown.
|
|
@ -1,6 +0,0 @@
|
|||
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
|
||||
; #Warn ; Enable warnings to assist with detecting common errors.
|
||||
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
|
||||
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
|
||||
|
||||
Run C:/Program Files (x86)/Google/Chrome/Application/chrome.exe "https://youtube.com"
|
||||
Binary file not shown.
19
src-tauri/commands/browser/ahk/_include.ahk
Normal file
19
src-tauri/commands/browser/ahk/_include.ahk
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
DefaultBrowser() {
|
||||
; Find the Registry key name for the default browser
|
||||
RegRead, BrowserKeyName, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice, Progid
|
||||
|
||||
; Find the executable command associated with the above Registry key
|
||||
RegRead, BrowserFullCommand, HKEY_CLASSES_ROOT, %BrowserKeyName%\shell\open\command
|
||||
|
||||
; The above RegRead will return the path and executable name of the brower contained within quotes and optional parameters
|
||||
; We only want the text contained inside the first set of quotes which is the path and executable
|
||||
; Find the ending quote position (we know the beginning quote is in position 0 so start searching at position 1)
|
||||
StringGetPos, pos, BrowserFullCommand, ",,1
|
||||
|
||||
; Decrement the found position by one to work correctly with the StringMid function
|
||||
pos := --pos
|
||||
|
||||
; Extract and return the path and executable of the browser
|
||||
StringMid, BrowserPathandEXE, BrowserFullCommand, 2, %pos%
|
||||
Return BrowserPathandEXE
|
||||
}
|
||||
|
|
@ -2,7 +2,6 @@ list:
|
|||
- command:
|
||||
action: ahk
|
||||
exe_path: ahk/Run browser.exe
|
||||
exe_args:
|
||||
voice:
|
||||
sounds:
|
||||
- ok1
|
||||
|
|
@ -11,13 +10,14 @@ list:
|
|||
phrases:
|
||||
- открой браузер
|
||||
- запусти браузер
|
||||
- открой гугл хром
|
||||
- открой хром
|
||||
- гугл хром
|
||||
|
||||
- command:
|
||||
action: ahk
|
||||
exe_path: ahk/Run google.exe
|
||||
exe_path: ahk/Run website.exe
|
||||
exe_args:
|
||||
- http://google.com
|
||||
voice:
|
||||
sounds:
|
||||
- ok1
|
||||
|
|
@ -26,14 +26,14 @@ list:
|
|||
- ok4
|
||||
phrases:
|
||||
- открой гугл
|
||||
- гугл
|
||||
- запусти гугл
|
||||
- перейди в гугл
|
||||
|
||||
- command:
|
||||
action: ahk
|
||||
exe_path: ahk/Run youtube.exe
|
||||
exe_path: ahk/Run website.exe
|
||||
exe_args:
|
||||
- http://youtube.com
|
||||
voice:
|
||||
sounds:
|
||||
- ok1
|
||||
|
|
@ -43,4 +43,20 @@ list:
|
|||
phrases:
|
||||
- открой ютуб
|
||||
- ютуб
|
||||
- запусти ютуб
|
||||
- запусти ютуб
|
||||
|
||||
- command:
|
||||
action: ahk
|
||||
exe_path: ahk/Run website.exe
|
||||
exe_args:
|
||||
- https://translate.google.com
|
||||
voice:
|
||||
sounds:
|
||||
- ok1
|
||||
- ok2
|
||||
- ok3
|
||||
- ok4
|
||||
phrases:
|
||||
- открой переводчик
|
||||
- переводчик
|
||||
- запусти переводчик
|
||||
Loading…
Add table
Add a link
Reference in a new issue