Resource icon

OBS Autostarter 0.5a

DaviBe

New Member
DaviBe submitted a new resource:

OBS Autostarter - Automatically start external programs when OBS starts

Automatically start external programs when OBS starts

Never forget to start programs like a Chatbot or Livesplit before your stream ever again.

- Add Script in OBS
- Select executable

If you want to launch more than one program, just duplicate the script and rename it.
e.g. autostarter1.lua, autostarter2.lua, etc.

Read more about this resource...
 

Psalcedo

New Member
windows no forund "Files\newTek\NDI"
is the spaces into de route the problem?

"C:\Program Files\NewTek\NDI 4 Tools\Webcam Input" is the correct route to exe file
 

DaviBe

New Member
windows no forund "Files\newTek\NDI"
is the spaces into de route the problem?

"C:\Program Files\NewTek\NDI 4 Tools\Webcam Input" is the correct route to exe file
Yes, the space in the Folder name was an issue, i fixed that in the Update.
 

DaviBe

New Member
Space on exe file has the same issue.
For example: streamlabs chatbot.exe
But works on chatty.exe so...
Yeah, ive put that in the script descritpion.
Cant find a way to start an .exe with a space in the name :(

workaround is to remove the space from the file name
 

Vowkin

New Member
Hello everyone,

I have fixed the problem that occcurs if there are spaces in the executables' names. The proper syntax in line 48 should be:
Lua:
cmd = 'start "" "' .. execPath .. '"'

The added quotation marks after the start command are for the window title. In our case, we do not want any title as the command prompt screen will close instantly anyway. Using this method, there is no need to have the execDir and execName variables either. You may also want to modify the description in line 20 ;)

I have also made some minor modifications to the spacing and style of the code, and have been trying to implement support for several executables from the same script so there is no need for duplication.

I would be happy to commit and push these changes myself, but I have not found the script in any public repository. Thank you!
 
Last edited:

DaviBe

New Member
Hello everyone,

I have fixed the problem that occcurs if there are spaces in the executables' names. The proper syntax in line 48 should be:
Lua:
cmd = 'start "" "' .. execPath .. '"'

The added quotation marks after the start command are for the window title. In our case, we do not want any title as the command prompt screen will close instantly anyway. Using this method, there is no need to have the execDir and execName variables either. You may also want to modify the description in line 20 ;)

I have also made some minor modifications to the spacing and style of the code, and have been trying to implement support for several executables from the same script so there is no need for duplication.

I would be happy to commit and push these changes myself, but I have not found the script in any public repository. Thank you!

Hi,
Yes, V0.2 has it implemented the way you described. The problem is some Programms like RetroSpy didn't load their config files when executed without citing the directory.

Yeah its not in any repo, its just something I've cobbled together for my own needs. Then loads of people told me they want it so I've uploaded it here.
 

Vowkin

New Member
Hi,
Yes, V0.2 has it implemented the way you described. The problem is some Programms like RetroSpy didn't load their config files when executed without citing the directory.

Yeah its not in any repo, its just something I've cobbled together for my own needs. Then loads of people told me they want it so I've uploaded it here.

Oh, I did not know that!

In that case you can use this line instead and it will work as I mentioned in my previous post, without the need for spaceless executable names ;)

Lua:
cmd = 'start "" /D "' .. execDir .. '" "' .. execName .. '"'
 
Last edited:
I wanted to autostart a BAT or VBS file instead of just an EXE, so I tweaked line 12 by adding other filetypes:

Code:
    obs.obs_properties_add_path(props, "execPath", "Executable", obs.OBS_PATH_FILE, "*.exe, *.vbs, *.bat, *.lnk, *.*", nil)

Perhaps others would like this also.
 

ASchneider

Member
Hello @DaviBe, thanks for this script! I was wondering: is it possible to have the exact opposite working as well? For example: close this app when OBS exists. I would like for OBS to close my bot app when I close it... Thanks!
 

BenAndo

Member
Is it possible to make it only ever have a program running once? As in if I open OBS, then close and re-open OBS now I have two instances of a program running, but I only want one instance running.
 

DaviBe

New Member
Finally had some time to address some of your requests :)
You can now start any File.
And its now possible to automatically close the programs when exiting OBS
 

ASchneider

Member
Hello @DaviBe! Thanks for the update, works really great. I was wondering, if it would be possible for the next update, to create a checkbox for minimize the started program after startup? This would be nice for apps like StreamerBot/TwitchSpeaker, for example, that you just need to be running but not at foreground. Thanks!
 
Top