OBS/Adminhilfe/Autohotkey: Unterschied zwischen den Versionen

Aus OBS Wiki
Zur Navigation springen Zur Suche springen
Für diese Seite wurde eine Zugriffsbeschränkung eingerichtet. Falls du diese Nachricht siehst, bist du nicht berechtigt, diese Seite einzusehen.
(Die Seite wurde neu angelegt: „My name is Hilton and I am studying Anthropology and Sociology and Earth Sciences at Palazzo Canavese / Italy.<br><br>My web blog [http://www.xechevroletphumyh…“)
 
 
(3 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
My name is Hilton and I am studying Anthropology and Sociology and Earth Sciences at Palazzo Canavese / Italy.<br><br>My web blog [http://www.xechevroletphumyhung.com/chevrolet/chevrolet-cruze-2017/ đại lý chevrolet cruze 2017]
{{ZugriffOBS}}
= Autohtokey =
AutoHotkey ist eine Skriptsprache und ein zugehöriger Interpreter, mit denen man die Windows-Benutzeroberfläche steuern kann. Mit Hilfe von AutoHotkey kann man sich wiederholende Arbeitsaufgaben unter Windows automatisieren.
 
Autohotkey kann hier bezogen werden:
[https://www.autohotkey.com/ Autohotkey Website]
==Script anlegen==
Um ein Script anzufertigen reicht es eine Datei mit der Endung '''.ahk''' anzulegen. Diese Datei kann dann auch in den Autostart eingefügt werden, damit ein Script automatisch immer im Hintergrund läuft. (Nützlich für Scripte mit Hotkeys).
 
=Autohotkey Scripte=
==Text aus Zwischenablage eingeben==
Ermöglicht es Text, der zuvor mit STRG + C in die Zwischenablage eingefügt wurde ausgeben zu lassen. Dies ist nützlich um z.B. lange Passwörter in einer Teamviewer-Sitzung nicht manuell eingeben zu müssen.
 
Folgendes Beispiel wirt mit STRG+ALT+NUM0 aktiviert:
<pre>
!^Numpad0::
    SendRaw %clipboard%
return
</pre>
 
==Hotstrings - Ersetzen von Zeichen beim Schreiben==
Beispiel Hotstring ersetzt beim Schreiben '''->''' mit '''→'''
<pre>
:*:->:: 
    Send {ASC 26}
return
</pre>
==Spotify Lautstärke ändern==
Bei folgendem Script können die Hotkey und die jeweilige Lautstärke nach Belieben angepasst werden. Der Rest sollte dann funktionieren.
Das Script muss nach dem Starten von Spotify ausgeführt werden.
 
Die Zeilen für die Anpassung sind folgende:
2Joy28:: SetAppVolume(ProcessId, 5)
2Joy29:: SetAppVolume(ProcessId, 100)
 
Hier das gesamte Script:
<pre>
If (!A_IsAdmin)
{
    MsgBox Run the Script as Administrator!
    ExitApp
}
 
Process Exist, Spotify.exe
ProcessId := ErrorLevel
If (!ProcessId)
{
    MsgBox Spotify is not running!
    ExitApp
}
 
 
2Joy28:: SetAppVolume(ProcessId, 5)
2Joy29:: SetAppVolume(ProcessId, 100)
Return
 
 
SetAppVolume(pid, MasterVolume)    ; WIN_V+
{
    IMMDeviceEnumerator := ComObjCreate("{BCDE0395-E52F-467C-8E3D-C4579291692E}", "{A95664D2-9614-4F35-A746-DE8DB63617E6}")
    DllCall(NumGet(NumGet(IMMDeviceEnumerator+0)+4*A_PtrSize), "UPtr", IMMDeviceEnumerator, "UInt", 0, "UInt", 1, "UPtrP", IMMDevice, "UInt")
    ObjRelease(IMMDeviceEnumerator)
 
    VarSetCapacity(GUID, 16)
    DllCall("Ole32.dll\CLSIDFromString", "Str", "{77AA99A0-1BD6-484F-8BC7-2C654C9A9B6F}", "UPtr", &GUID)
    DllCall(NumGet(NumGet(IMMDevice+0)+3*A_PtrSize), "UPtr", IMMDevice, "UPtr", &GUID, "UInt", 23, "UPtr", 0, "UPtrP", IAudioSessionManager2, "UInt")
    ObjRelease(IMMDevice)
 
    DllCall(NumGet(NumGet(IAudioSessionManager2+0)+5*A_PtrSize), "UPtr", IAudioSessionManager2, "UPtrP", IAudioSessionEnumerator, "UInt")
    ObjRelease(IAudioSessionManager2)
 
    DllCall(NumGet(NumGet(IAudioSessionEnumerator+0)+3*A_PtrSize), "UPtr", IAudioSessionEnumerator, "UIntP", SessionCount, "UInt")
    Loop % SessionCount
    {
        DllCall(NumGet(NumGet(IAudioSessionEnumerator+0)+4*A_PtrSize), "UPtr", IAudioSessionEnumerator, "Int", A_Index-1, "UPtrP", IAudioSessionControl, "UInt")
        IAudioSessionControl2 := ComObjQuery(IAudioSessionControl, "{BFB7FF88-7239-4FC9-8FA2-07C950BE9C6D}")
        ObjRelease(IAudioSessionControl)
 
        DllCall(NumGet(NumGet(IAudioSessionControl2+0)+14*A_PtrSize), "UPtr", IAudioSessionControl2, "UIntP", ProcessId, "UInt")
        If (pid == ProcessId)
        {
            ISimpleAudioVolume := ComObjQuery(IAudioSessionControl2, "{87CE5498-68D6-44E5-9215-6DA47EF883D8}")
            DllCall(NumGet(NumGet(ISimpleAudioVolume+0)+3*A_PtrSize), "UPtr", ISimpleAudioVolume, "Float", MasterVolume/100.0, "UPtr", 0, "UInt")
            ObjRelease(ISimpleAudioVolume)
        }
        ObjRelease(IAudioSessionControl2)
    }
    ObjRelease(IAudioSessionEnumerator)
}
</pre>

Aktuelle Version vom 27. Oktober 2020, 11:08 Uhr

Dies ist eine zugriffsgeschützte Seite.


Admin-Hilfe

OBS-Administration / Installation
kundenspezifische Anpassungen
OBS Protokolle
Shop-Administration

Autohtokey

AutoHotkey ist eine Skriptsprache und ein zugehöriger Interpreter, mit denen man die Windows-Benutzeroberfläche steuern kann. Mit Hilfe von AutoHotkey kann man sich wiederholende Arbeitsaufgaben unter Windows automatisieren.

Autohotkey kann hier bezogen werden: Autohotkey Website

Script anlegen

Um ein Script anzufertigen reicht es eine Datei mit der Endung .ahk anzulegen. Diese Datei kann dann auch in den Autostart eingefügt werden, damit ein Script automatisch immer im Hintergrund läuft. (Nützlich für Scripte mit Hotkeys).

Autohotkey Scripte

Text aus Zwischenablage eingeben

Ermöglicht es Text, der zuvor mit STRG + C in die Zwischenablage eingefügt wurde ausgeben zu lassen. Dies ist nützlich um z.B. lange Passwörter in einer Teamviewer-Sitzung nicht manuell eingeben zu müssen.

Folgendes Beispiel wirt mit STRG+ALT+NUM0 aktiviert:

!^Numpad0::
    SendRaw %clipboard%
return

Hotstrings - Ersetzen von Zeichen beim Schreiben

Beispiel Hotstring ersetzt beim Schreiben -> mit

:*:->::  
    Send {ASC 26} 
return

Spotify Lautstärke ändern

Bei folgendem Script können die Hotkey und die jeweilige Lautstärke nach Belieben angepasst werden. Der Rest sollte dann funktionieren. Das Script muss nach dem Starten von Spotify ausgeführt werden.

Die Zeilen für die Anpassung sind folgende:

2Joy28:: SetAppVolume(ProcessId, 5)
2Joy29:: SetAppVolume(ProcessId, 100)

Hier das gesamte Script:

If (!A_IsAdmin)
{
    MsgBox Run the Script as Administrator!
    ExitApp
}

Process Exist, Spotify.exe
ProcessId := ErrorLevel
If (!ProcessId)
{
    MsgBox Spotify is not running!
    ExitApp
}


2Joy28:: SetAppVolume(ProcessId, 5)
2Joy29:: SetAppVolume(ProcessId, 100)
Return


SetAppVolume(pid, MasterVolume)    ; WIN_V+
{
    IMMDeviceEnumerator := ComObjCreate("{BCDE0395-E52F-467C-8E3D-C4579291692E}", "{A95664D2-9614-4F35-A746-DE8DB63617E6}")
    DllCall(NumGet(NumGet(IMMDeviceEnumerator+0)+4*A_PtrSize), "UPtr", IMMDeviceEnumerator, "UInt", 0, "UInt", 1, "UPtrP", IMMDevice, "UInt")
    ObjRelease(IMMDeviceEnumerator)

    VarSetCapacity(GUID, 16)
    DllCall("Ole32.dll\CLSIDFromString", "Str", "{77AA99A0-1BD6-484F-8BC7-2C654C9A9B6F}", "UPtr", &GUID)
    DllCall(NumGet(NumGet(IMMDevice+0)+3*A_PtrSize), "UPtr", IMMDevice, "UPtr", &GUID, "UInt", 23, "UPtr", 0, "UPtrP", IAudioSessionManager2, "UInt")
    ObjRelease(IMMDevice)

    DllCall(NumGet(NumGet(IAudioSessionManager2+0)+5*A_PtrSize), "UPtr", IAudioSessionManager2, "UPtrP", IAudioSessionEnumerator, "UInt")
    ObjRelease(IAudioSessionManager2)

    DllCall(NumGet(NumGet(IAudioSessionEnumerator+0)+3*A_PtrSize), "UPtr", IAudioSessionEnumerator, "UIntP", SessionCount, "UInt")
    Loop % SessionCount
    {
        DllCall(NumGet(NumGet(IAudioSessionEnumerator+0)+4*A_PtrSize), "UPtr", IAudioSessionEnumerator, "Int", A_Index-1, "UPtrP", IAudioSessionControl, "UInt")
        IAudioSessionControl2 := ComObjQuery(IAudioSessionControl, "{BFB7FF88-7239-4FC9-8FA2-07C950BE9C6D}")
        ObjRelease(IAudioSessionControl)

        DllCall(NumGet(NumGet(IAudioSessionControl2+0)+14*A_PtrSize), "UPtr", IAudioSessionControl2, "UIntP", ProcessId, "UInt")
        If (pid == ProcessId)
        {
            ISimpleAudioVolume := ComObjQuery(IAudioSessionControl2, "{87CE5498-68D6-44E5-9215-6DA47EF883D8}")
            DllCall(NumGet(NumGet(ISimpleAudioVolume+0)+3*A_PtrSize), "UPtr", ISimpleAudioVolume, "Float", MasterVolume/100.0, "UPtr", 0, "UInt")
            ObjRelease(ISimpleAudioVolume)
        }
        ObjRelease(IAudioSessionControl2)
    }
    ObjRelease(IAudioSessionEnumerator)
}