Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
JohnAJ

Arma + Sublime Text Development Environment

Recommended Posts

Hi!

I created a batch script that lets you choose from your created missions and opens up the corresponding directory in explorer.exe and Sublime Text.

@echo off
set /a c=1
setlocal ENABLEDELAYEDEXPANSION

for /f "usebackq delims=|" %%f in (`dir /b "E:\Documents\ArmA 2 Other Profiles\JohnAJ\missions"`) do (
   set files[!c!]=%%f
   echo !c!, %%f
  	set /a c+=1
)

:Ask
set /P num=Please enter number: 
if "%num%"=="" goto Ask
%SystemRoot%\explorer.exe "E:\Documents\ArmA 2 Other Profiles\JohnAJ\missions\!files[%num%]!"
sublime_text "E:\Documents\ArmA 2 Other Profiles\JohnAJ\missions\!files[%num%]!" > NUL
exit /b

E:\Documents\ArmA 2 Other Profiles\JohnAJ\missions is my Arma 2 missions directory. Replace all three occasions with the directory path on your system.

Also, make sure that the Sublime Text installation directory is in your PATH. Add

;C:\path\to\sublime\text

to Computer -> Properties -> Advanced -> Environment Variables -> PATH -> Edit.

If you don't want the Explorer window to open, remove the line starting with %SystemRoot%\explorer.exe.

Let me know what you think! You could definitely make some improvements (like storing the missions directory path in a variable). Thanks!

(I also uploaded it as a gist on Github.)

Share this post


Link to post
Share on other sites
Sign in to follow this  

×