Jump to content

Change file and text assigned to button

Recommended Posts


Hello everyone,

I'm sure I will not use correct terminology, but will try and explain what I'm looking for as clear as I can. I have a few hours worth of experience with AutoIt and pretty much coding in general. I'm trying to take what I've already put together and create a way to click on one of the buttons and assign it an audio file, using a window(GUI) input. Please see the attached file.


Func OnYes()
    MsgBox(0, "Available...", "Open Slot", @HotKeyPressed)     <------------------------------ change this to a file address in order to play an mp3 sound clip
EndFunc   ;==>OnYes


Func OnYes()
    SoundPlay("C:\Music\RandomSoundClip.mp3", @HotKeyPressed)
EndFunc   ;==>OnYes

However, also want to be able to change the button text from 'Yes' to anything else i.e. 'Clip'. Basically just changing the button name like the following...

    $YesID = GUICtrlCreateButton("Yes", 290, 100, 50, 20)
    GUICtrlSetOnEvent($YesID, "OnYes")

    $YesID = GUICtrlCreateButton("Random", 290, 100, 50, 20)
    GUICtrlSetOnEvent($YesID, "OnRandom")

So again... I want to be able to click on a button and assign it an audio file (or even a program to open) and change the button text. What I have (see attached file) works ok, but I want to be able to change audio files assigned to buttons, and want to compile this into an .exe so I can put it on the start menu and tool bar, add my own icon and stuff like that. This is what I'm using as a Streaming Desk for sound clips and opening programs.

Thank you to anyone that helps, hope I'm in the right place.

Streamer Deck.au3

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now