I'll try to explain as precisely as I can.
I bought the Elgato Stream Deck and if you know about it you might also know that it does not support macros, unfortunately. So I'm in a bit of a pickle, cause I want to be able to use it with my SoundPad software where on that I have it set up to play different sounds when I hold Alt and then types the number that corresponds with a song on the numpad. And that seems to be impossible using only the Elgato Stream Deck software.
So! I decided to turn to Autohotkey, and my thought process is to create a folder with a lot of scripts with 1-100+ as names and having the actual script being alt+1, alt+10, alt+35 and so on for each script and then have the Stream Deck to open these files when I press a button. This would be an extremely tedious and time-consuming task to do manually (cause I have so many damn sound clips) so I'm asking, is there a way to automate this process?
PS: If anyone knows a better/simpler way with the same result, I would really appreciate it if you could share that idea.
Generate 100+ scripts for a Elgato Stream Deck Soundpad
-
- Posts: 2
- Joined: 17 Jul 2018, 15:02
Re: Generate 100+ scripts for a Elgato Stream Deck Soundpad
I don't know if your approach is the best one.
Making lots of files and writing into them would be easy enought with AHK, but the hotkeys you need would not be so easy to implement.
Lets say you have file on song1 (Alt + Numpad1), also the file song11 (Alt + Numpad1 + Numpad1)?
This would not work as you would imagine.
This is a simple code that goes along with your current thinking just to prove the file concept:
Making lots of files and writing into them would be easy enought with AHK, but the hotkeys you need would not be so easy to implement.
Lets say you have file on song1 (Alt + Numpad1), also the file song11 (Alt + Numpad1 + Numpad1)?
This would not work as you would imagine.
This is a simple code that goes along with your current thinking just to prove the file concept:
Code: Select all
Loop, 99 ;Or the number of scripts you want...
{
If (A_Index>=10){
first_digit:=SubStr(A_Index, 1, 1)
second_digit:=SubStr(A_Index, 2, 1)
text_script =
(
#if GetKeyState("Numpad%first_digit%", "P")
!Numpad%second_digit%::
Run, song%A_Index%.mp3 ;Or the command you need for each hotkey here.
)
} Else {
text_script =
(
!Numpad%A_Index%::
Run, song%A_Index%.mp3 ;Or the command you need for each hotkey here.
)
}
FileAppend, %text_script%, alt+%A_Index%.ahk
}
Re: Generate 100+ scripts for a Elgato Stream Deck Soundpad
Been meaning to pick up a StreamDeck for a while, and write something using it's API.
I just put a bid of £80 for one in an Ebay auction, ends Sunday.
I just put a bid of £80 for one in an Ebay auction, ends Sunday.
-
- Posts: 2
- Joined: 17 Jul 2018, 15:02
Re: Generate 100+ scripts for a Elgato Stream Deck Soundpad
Wow that code looks way to complex for me, haha. I think you misunderstood me though (I wasn't clear enough). Here's how the soundpad software I use looks likeFreire wrote:I don't know if your approach is the best one.
Making lots of files and writing into them would be easy enought with AHK, but the hotkeys you need would not be so easy to implement.
Lets say you have file on song1 (Alt + Numpad1), also the file song11 (Alt + Numpad1 + Numpad1)?
This would not work as you would imagine.
This is a simple code that goes along with your current thinking just to prove the file concept:Code: Select all
Loop, 99 ;Or the number of scripts you want... { If (A_Index>=10){ first_digit:=SubStr(A_Index, 1, 1) second_digit:=SubStr(A_Index, 2, 1) text_script = ( #if GetKeyState("Numpad%first_digit%", "P") !Numpad%second_digit%:: Run, song%A_Index%.mp3 ;Or the command you need for each hotkey here. ) } Else { text_script = ( !Numpad%A_Index%:: Run, song%A_Index%.mp3 ;Or the command you need for each hotkey here. ) } FileAppend, %text_script%, alt+%A_Index%.ahk }
Spoiler
and when I hold Alt and then press 1+2 and then release Alt it plays the 12th sound on the list so I need a workaround the stream decks strict hotkeys only method by having it open the ahk files instead which then does the alt+1+2-alt "macro" to play a sound.Re: Generate 100+ scripts for a Elgato Stream Deck Soundpad
Outbid already
I did have some guy saying he would be willing to loan me one so I could code for it, but I forget who it was, would have to try and get back in touch.
I did have some guy saying he would be willing to loan me one so I could code for it, but I forget who it was, would have to try and get back in touch.
Re: Generate 100+ scripts for a Elgato Stream Deck Soundpad
For Future Reference:
Code: Select all
Loop, 100 ;Or the number of scripts you want...
{
If (A_Index>=100){
first_digit:=SubStr(A_Index, 1, 1)
second_digit:=SubStr(A_Index, 2, 1)
third_digit:=SubStr(A_Index, 3, 1)
text_script =
(
SetKeyDelay, 100
Send, {Alt Down}{Numpad%first_digit%}{Numpad%second_digit%}{Numpad%third_digit%}{Alt Up}
)
} Else If (A_Index>=10){
first_digit:=SubStr(A_Index, 1, 1)
second_digit:=SubStr(A_Index, 2, 1)
text_script =
(
SetKeyDelay, 100
Send, {Alt Down}{Numpad%first_digit%}{Numpad%second_digit%}{Alt Up}
)
} Else {
text_script =
(
SetKeyDelay, 100
Send, {Alt Down}{Numpad%A_Index%}{Alt Up}
)
}
FileAppend, %text_script%, %A_Index%.ahk
}
Re: Generate 100+ scripts for a Elgato Stream Deck Soundpad
FYI, I just bought a Stream Deck
As soon as I get it I will be looking into implementing an AHK wrapper for the Elgato API
As soon as I get it I will be looking into implementing an AHK wrapper for the Elgato API
Re: Generate 100+ scripts for a Elgato Stream Deck Soundpad
Started a Stream Deck wrapper for AHK: https://autohotkey.com/boards/viewtopic ... 27#p231827